Subject: ksh vs sh quoting
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 07/27/2004 16:29:47
While trying to track down a libtool problem on yesterday's
NetBSD-current/i386, I ended up with:
================= foo ==================
Xsed='sed -e s/^X//'
no_glob_subst='s/\*/\\\*/g'
output_cmd="hello"
echo "output_cmd: ($output_cmd)"
output_cmd="`echo \"X$output_cmd\" | $Xsed -e \"$no_glob_subst\"`"
echo "output_cmd: ($output_cmd)"
========================================
% sh bar (also OK with bash)
output_cmd: (hello)
output_cmd: (hello)
% ksh bar
output_cmd: (hello)
sed: 1: ""s/\*/\\\*/g"": invalid command code "
output_cmd: ()
Any thoughts on what's up with the quoting?
Cheers,
Patrick