bug-bash
[Top][All Lists]
Advanced

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

Re: How to protect > and interpret it later on? (w/o using eval)


From: Peng Yu
Subject: Re: How to protect > and interpret it later on? (w/o using eval)
Date: Fri, 2 Dec 2011 08:26:28 -0600

> WHAT are you trying to DO?

I think that you might completely miss my point. I try to explain it
better. Let me know if this time it makes more sense to you.

I want to execute any command as if the 'execute.sh' does not present,
except that I want to print the command so that I know want the
command is executed. (This can be used when I call several commands in
a script and I know what part of the output associated to what
command). E.g. I can run

ls > /tmp/tmp.txt

When I call,

execute.sh ls > /tmp/tmp.txt

I want it actually to do

echo "ls > /tmp/tmp.txt"
ls > /tmp/tmp.txt


Note that I could define execute.sh such that

execute.sh "ls > /tmp/tmp.txt"

means

echo "ls > /tmp/tmp.txt"
eval "ls > /tmp/tmp.txt"

But this interface of execute.sh is not as good the previous one.

Note that there could be other symbols that bash normal process, such as '2>&1'.

I'm looking for a general solution, Pierre's answer is not as general as I want.

The FAQ http://mywiki.wooledge.org/BashFAQ/050 doesn't really answer
my question.

BTW, where is the help-bash mailing list mentioned (at least not on
bash home page)? I have never seen it before.

http://tiswww.case.edu/php/chet/bash/bashtop.html

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]