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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cooproces in command line

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
Hi,

i have a text file containing two below lines:
jfslog1_lv jfslog 1 2 2 open/syncd N/A
jfslog2_lv jfslog 1 2 2 open/syncd N/A


When I run below command I get 2 unexpected lines on output (first and last one). How to rid them off? Is the command syntax ok? Or maybe these to lines are also ok working with cooprocess?


$ cat lsvg.txt |& while read -p;do set `echo $REPLY`;echo "mklv -y'${1}' myvg ${3} raid10_l1";done
[1] 1261726
mklv -y'jfslog1_lv' myvg 1 raid10_l1
mklv -y'jfslog2_lv' myvg 1 raid10_l1
[1] + Done cat lsvg.txt |& while read -p;do set `echo $REPLY`;echo "mklv -y'${1}' myvg ${3} raid10_l1";done
 
your problem is marked in red:

cat lsvg.txt |[red]&[/red] while read -p;do set `echo $REPLY`;echo "mklv -y'${1}' myvg ${3} raid10_l1";done

 
Why not simply this ?
while read -p;do set `echo $REPLY`;echo "mklv -y'${1}' myvg ${3} raid10_l1";done < lsvg.txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top