views:

51

answers:

1

i have a file contain list of path now i want to execute command on each line example :-

file name : rawabdeh
command : command

file contain:-

path/no/1/
path/no/2/
path/no/3/ 

i want to do the following :

command path/no/1/
command path/no/2/
command path/no/3/

+1  A: 
while read path <&3
do
  command "$path" 3<&-
done 3<rawabdeh

This will execute command on each of the paths -- is this what you're trying to achieve?

Roman Cheplyaka
i will try it now .... put the path in the same file "rawabdeh" ...each line of file is path
Osama Ahmad
the following result accour for all line in file ...ksh[2]: /var/lib/svn/repos/b1me/products/payone/generic/code/core/: cannot executeksh[2]: /var/lib/svn/repos/b1me/products/payone/generic/code/fees/: cannot executeksh[2]: /var/lib/svn/repos/b1me/products/payone/generic/code/merchantserver/: cannot executeksh[2]: /var/lib/svn/repos/b1me/products/payone/generic/code/2ds/: cannot executeksh[2]: /var/lib/svn/repos/b1me/products/payone/generic/code/iris/: cannot execute
Osama Ahmad
Did you erase the first word on the third line? It should be your command. Anyway, paste your complete script so we can say what's wrong.
Roman Cheplyaka
ok ok thank you :) ...it is work 100%
Osama Ahmad