Nov 8, 2002 #1 OieL MIS Sep 6, 2002 17 US find . *.bak | d_script.sh in my script d_script.sh , i want to manipulate each line of output of find ... how will I capture each to a variable ? any ideas to do this ? I know that in "d_script.sh FILE" FILE is $1, what about in pipes.
find . *.bak | d_script.sh in my script d_script.sh , i want to manipulate each line of output of find ... how will I capture each to a variable ? any ideas to do this ? I know that in "d_script.sh FILE" FILE is $1, what about in pipes.
Nov 9, 2002 #2 jamisar Programmer Jul 31, 2002 523 CH in 'd_script.sh' #!/bin/sh for myinput do echo $myinput # your work done then type: d_script.sh 'find . -name \*\.bat' ALTERNATIVE find . -name \*\.bat |xargs d_script.sh ----------- when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older ! Upvote 0 Downvote
in 'd_script.sh' #!/bin/sh for myinput do echo $myinput # your work done then type: d_script.sh 'find . -name \*\.bat' ALTERNATIVE find . -name \*\.bat |xargs d_script.sh ----------- when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
Nov 10, 2002 #3 vdsouza Programmer Oct 17, 2002 16 GB alternative in 'd_script.sh' for i in `find . -name $1` do echo $i #ur work done pass what u want to find as a command line argument e.g. d_script.sh *.bak Upvote 0 Downvote
alternative in 'd_script.sh' for i in `find . -name $1` do echo $i #ur work done pass what u want to find as a command line argument e.g. d_script.sh *.bak
Nov 11, 2002 #4 danielhozac Programmer Aug 21, 2001 2,058 SE Yet another way Code: while read line; do #$line contains this file done //Daniel Upvote 0 Downvote