TuskenTower on 21 Aug 2009 12:09:13 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] the character least likely to find in a Unix file name


We have an interesting point of discussion about the following two sed lines:
   PATH=`echo $PATH | sed "s"'$'"$old_paht"'$'"$new_path"'$'`
VS
   PATH=`echo $PATH | sed "s,$old_path,$new_path,"`

We would like to have a sed script that modifies the PATH in a way
that follows the principle of least astonishment.

Someone decided the dollar sign was the least likely to find in a
filename and produced the above code.  Another voiced concern over
legibility and to stick to characters that don't require escaping.
Another said the semi-colon was the best option.  The discussion
degenerated into using tilde, back tick and a few others that cause
weird things.

Any thoughts?
Amul
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug