954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help Needed using File command in Shell scripts

file_list='find /home/attrib/ -name *.csv'
for fn in $file_list
do
echo "Inside the loop"
echo $fn
done

I need the list files available in the specified directory
find /home/attrib/ -name *.csv - This works on the command line and gives the desired output .
But the above script Gives me output sme thing like

find
/home/attrib/
-name
*.csv

Am completely new to shell scripting ...Please help me

shyamalaa
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Check which quote you are using. On the keyboard it should be the one that slants from the upper left to the lower right, not the other way around and not straight up and down. In the code, it should also appear to slant in that direction and not appear in one of the other two ways.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Thanks for the reply ..But am not getting wat u r trying to tell . There is only one single quote available right " ' " . Can u explain it a lill more pls

shyamalaa
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Hey Thanks for the reply ...Tht worked

shyamalaa
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You