The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 03-25-2008
unilover unilover is offline
Registered User
 

Join Date: Mar 2008
Location: Toronto, Canada
Posts: 66
Try:

tr ' ' '\n' <file |sed "s/^/$CMND /" | sh

The above pipe-lined command will put $CMND (i.e. whatever is in CMND variable) before each word as one per line and then will execute all of them, again in sequence.

I hope this is what you wanted to do.
Reply With Quote