View Single Post
  #4   (View Single Post)  
Old 28th December 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

I found in this in a on old dump(8) I restored 2 days ago. What else has a man to do on the second day of Christmas?

I cannot recall why I wrote it, probably to show somebody on bsdforums.org who had a problem with this, at least for most beginning sh programmers, whitespace madness.

Indeed it has like both of you mentioned something to do with 'IFS' (inter field separator), a shell variable holding the characters, the shell uses to break up a string into words.
Code:
$ X='x      y    z'

$ echo "$X"
x      y    z

$ echo $X
x y z

$ IFS_ORIG=$IFS
$ IFS=''

$ echo $X       
x      y    z

$ IFS=$IFS_ORIG
$ echo $X
x y z
As shown here, after setting IFS to nothing, the "echo $X" shows the original whitespace.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote