Shell script passing variables
I have a procedure that creates two files only one of theses files is created at a time depending on if there was an error or not, what I need to do is to search a specified directory and pickup the name of the file that is in there and then be able to store this a a variable so that the script can then just pass in the variable to see which script to run next. I have tried something like this #!/bin/bash for file in 'ls /u1/dev/procedures/sales/*.sh'; do
########### but all i get returned is 'ls /u1/dev/procedures/sales/<filename>.sh' All I need returned is just the filename.
Do a man on basename
You don't need 'ls' or quotes. Try:
See Also
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|