There are a lot of ways. First question: Why do you want the index? Stop and think about what you want to use it for, and maybe you can go directly to the need instead of by steps. Do you want everything to the left (or right) of the ':'? leftpart=$(echo $first | cut -f 1 -d ':')rightpart=$(echo $first | cut -f 2 -d ':') Do you want to split it into pieces and handle them individually?
for part in $(echo $first|tr ':' ' ') ; do
You can also try to use the ternary operator if you use a recent bash shell, but I've been having trouble finding a good example. I also often use awk (gawk for the gnu version) which is pretty arcane, but quite useful. Or step up to Python or perl?
Can u help me out..I want to make some tables and give some querries in mysql. And I want to automate this... So can someone help me to write a script which will do all this....
It should open mysql....put in the password and must be able to type something in it.
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...