Summary: For repetitive executions, you need to choose either to go with cron or to make your script a sleeper script. You can schedule it in cron to run as fr...
Summary: In the solution below, awk will process only lines that have 2 or more fields (delimited by any amount of white space) and field1 must contain an at-s...
Summary: When running the script below I get nothing.. I am a newbie with this. Not sure If you can run awk in a script. Also Im having problems getting a vari...
Summary: Hi all, I need to read lines from a file "a.txt" that represents a directory and process something with that directory information.. The shell script ...
Summary: Variable assignment in most shells is without spaces around the equal-sign: DIRS="at_1 be_1 ch_1" You will notice that my "main.txt" is in double-quot...
Summary: I have a text data file that has spaces between fields and looks something like:- tom mazda keith ford mary ford I'm trying to write a shell script th...
Summary: You missed the $ from $test print $(print $test) 1 However if you want arrays, ksh has them: set -A planets Mercury Venus Earth Mars Jupiter print ${p...
Summary: If it works for you fine, but let me point out a potential problem the way you use the for loop: Your script works because you have only 1 server name...
Summary: On my HP-UX, the maximum length of a printf statement (single or multiple tokens) is 3000 characters: awk: Format item %s cannot be longer than 3,000 ...
Summary: Hi, i am unable to assign an expression to variable. like in a for loop for i in `cat isa1` do txn = `cat x12result|grep -l $i|tr -s ' ' ""|cut -f 2...
Summary: The awk solution below is pretty simple, analyzing a word at a time for possible downshift. It changes the input buffer ($5=whatever), so that might...
Summary: Hi, I get an error msg when executing some stored procedure. error is: exception : looking for handler SQL error = -668 ISAM error = -2 error string ...
Summary: To get a list of values loaded into an array indexed numerical as you are doing, you can do: split("A B C D E F G",list) or maybe using another delimi...
Summary: #!/bin/ksh for ruleNum in $@ do grep "^$ruleNum" rules done I didn't test this, but think that it's correct. The $@ in the for loop lists all of th...
Summary: Here is an awk solution, although it can be done easily with sed also. If the second line ends with an equal-sign followed by one or more spaces, it ...
Summary: Put the compress in background. Example: #!/bin/ksh for file in * do if [[ ! -d $file ]] then cp $file /newdirectory/$file compress /newdirectory/$fi...
Summary: Hey all, This problem's been doing my head in, and I hoping that someone can point to me the error of my ways. Korn shell script, that takes in a fil...
Summary: ls -t will order the filenames by time beginning with the most recent (use ls -tr to reverse that order). Each loop of the for-loop can do whatever ...
Summary: If the field count is unimportant but you just want to deal with the values of each field, the tr command could be used to translate commas to carriag...
Summary: Hey Ravi, what's up with using cat? It is totally unnecessary! Do a google search on UUOC. Your example qualifies. #!/bin/ksh for user in $(awk -F:...
Summary: Hi: A way ... awk ' BEGIN { FS="/" # change field separator OFS="/" # set output field separator dash="-" } { # process up to the last field for (i =...
Summary: ------------------ in the previous reply ie., soln for 3 there is an error just change the for statement as for(i=0;iNF;i++) ------------------ actua...
Summary: awk's "split" function turns a string into an array, e.g: echo "1ab4-abc" | awk '{split($0,string,""); for (e in string) print e, "=", string[e]}' | s...