View Single Post

  #2 (permalink)  
Old 01-09-2006, 02:35 PM
monk's Avatar
monk monk is offline
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Very easy at shell prompt try something as follows:

U="one two three"
Code:
for i in $U; do echo $i; done
Or
Code:
U=`cut -d: -f1 /etc/passwd`
for i in $U; do echo $i; done
You can add above lines to script and it should work with both sh and bash shell under any Linux/UNIX/BSD os
Reply With Quote