Register
It is currently Fri Oct 31, 2014 7:13 pm

For loop help


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Thu Oct 21, 2010 6:22 am   

Joined: Thu Oct 21, 2010 6:20 am
Posts: 1
So basically what I have to do is write a bash script which will search for the smallest number in the list given as input parameters, and displayed on standard output. And I have to use a for loop to solve this...

All help would be appreciated

:*


Top
 Profile  
 PostPosted: Thu Oct 21, 2010 10:56 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
We are happy to help you when you have homework problems but we're not just going to do it for you.


Top
 Profile  
 PostPosted: Thu Oct 21, 2010 3:33 pm   
User avatar

Joined: Tue Apr 27, 2010 2:28 pm
Posts: 172
Location: Czech Republic
Without a for loop, it seems easy enough :-B :
Code:
sed 's/ /\n/g' <<< "$@" | sort -n | head -n1


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP