Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by byh

  1. byh

    shell while loop broken after using AWK

    Dear PH, Thanks to your reply, the program works much better. The loop continues as I wanted. But the out puts are not quite right: The line read is "/u/wx52bh/tmp/grads/get_time.gsf" I wish to get two line outputs cdir=/u/wx52bh/tmp/grads fnm =get_time.gsf But what I got is cdir= fnm...
  2. byh

    shell while loop broken after using AWK

    #!/bin/sh while read x1 x2 x3 x4 x5 x6 x7 x8 nc do eval "$(awk -v string="$nc" 'BEGIN {num=split(string,a,"/")} {len=length(string)} {lenx=length(a[num])} {printf "cdir=%s\n", substr(string,1,len-lenx-1)} END {printf "fnm=%s\n", a[num]}' )" echo 'nc='$nc' cdir='$cdir' fnm='$fnm done <...

Part and Inventory Search

Back
Top