On Mon, May 11, 2009 at 10:35:18AM +1000, Jon Seymour wrote:
> I am trying to parse untrusted strings and represent in a form that
> would be safe to execute.
printf "%q"
> cmd="echo"
> for a in "$@"
> do
> cmd="$cmd '${a/\'/''}'"
> done
> echo "$cmd"
> eval "$cmd"
http://mywiki.wooledge.org
Yes, I realised that I should have at least used // after I posted,
not that that would have been sufficient. Thanks for the solution.
jon.
On Mon, May 11, 2009 at 10:20 PM, Greg Wooledge wrote:
> On Mon, May 11, 2009 at 10:35:18AM +1000, Jon Seymour wrote:
>> I am trying to parse untrusted stri
Command prompt:
Abbreviation of home path by tilde is not working when $HOME has a trailing
slash
reproduce:
export HOME=$HOME/
watch prompt
cheers
Christoph
For your info:
echo $PS1
${debian_chroot:+($debian_chroot)}...@\h:\w\$
Dr. Christoph Gille wrote:
> Command prompt:
> Abbreviation of home path by tilde is not working when $HOME has a trailing
> slash
A tilde-prefix can never include a trailing slash, so it won't match a
value of HOME that has one.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Ch