User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,572 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1098 | Replies: 3 | Solved
Reply
Join Date: Aug 2007
Posts: 4
Reputation: shyamalaa is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shyamalaa shyamalaa is offline Offline
Newbie Poster

Help Needed using File command in Shell scripts

  #1  
Aug 21st, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,509
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: Help Needed using File command in Shell scripts

  #2  
Aug 21st, 2007
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.
Last edited by masijade : Aug 21st, 2007 at 6:37 am. Reason: edit: sorry got the corners wrong.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Aug 2007
Posts: 4
Reputation: shyamalaa is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shyamalaa shyamalaa is offline Offline
Newbie Poster

Re: Help Needed using File command in Shell scripts

  #3  
Aug 21st, 2007
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
Reply With Quote  
Join Date: Aug 2007
Posts: 4
Reputation: shyamalaa is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shyamalaa shyamalaa is offline Offline
Newbie Poster

Solution Re: Help Needed using File command in Shell scripts

  #4  
Aug 21st, 2007
Hey Thanks for the reply ...Tht worked
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC