On Wed, 6 Apr 2011, ali hagigat wrote:

I have a variable like this:
var1=Makefile .xcompile /root/build/.config src/arch/i386/Makefile.inc
means some words separated by spaces. I want to print each word on a
separate line. I think I have to use "awk" or "sed" string processing
tools. I wonder if anybody have experience with them or any other
means to do it.

printf "%s\n" $var1

  (You might want to precede that with 'set -f'.)

--
   Chris F.A. Johnson, <http://cfajohnson.com/>
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

Reply via email to