Mar 12, 2009 #1 tekpr00 IS-IT--Management Joined Jan 22, 2008 Messages 186 Location CA Hello, please help. I have a directory ls testa.txt testb.txt I will like to pass both files to one variable in my script #! /bin/sh #enter files FILES=testa.* ; testb.* echo $FILES exit However, this little script gives me error. Please helo
Hello, please help. I have a directory ls testa.txt testb.txt I will like to pass both files to one variable in my script #! /bin/sh #enter files FILES=testa.* ; testb.* echo $FILES exit However, this little script gives me error. Please helo
Mar 12, 2009 #2 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi Maybe this : Code: FILES="$( echo testa.* testb.* )" [gray]# or[/gray] FILES="$( echo test?.txt )" Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Maybe this : Code: FILES="$( echo testa.* testb.* )" [gray]# or[/gray] FILES="$( echo test?.txt )" Feherke. http://rootshell.be/~feherke/
Mar 12, 2009 Thread starter #3 tekpr00 IS-IT--Management Joined Jan 22, 2008 Messages 186 Location CA Nope did not work.. Last line echo $FILES displays "$( echo testa.* testb.* )" I will like it to list testa.txt testb.txt as seperate files Thanks Upvote 0 Downvote
Nope did not work.. Last line echo $FILES displays "$( echo testa.* testb.* )" I will like it to list testa.txt testb.txt as seperate files Thanks
Mar 12, 2009 Thread starter #4 tekpr00 IS-IT--Management Joined Jan 22, 2008 Messages 186 Location CA I have been able to solve it by using FILES=`ls test?.txt` thanks Upvote 0 Downvote
Mar 12, 2009 #5 SamBones Programmer Joined Aug 8, 2002 Messages 3,186 Location US What shell are you using? Upvote 0 Downvote