[Top][All Lists]

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

Re: [Help-bash] How to protect > and interpret it later on? (w/o using e

From: Peng Yu
Subject: Re: [Help-bash] How to protect > and interpret it later on? (w/o using eval)
Date: Sun, 4 Dec 2011 00:42:53 -0600

> THAT will work.  But why are you writing a script to read a shell command
> and then execute it?  There is already a program that reads shell commands

This capability will be useful for debugging bash script.

For example, I have a set of commands in a bash script, each of them
output some thing to stdout. However, I can not tell the start and end
of each output. I could have a command that does what I expect to do.


I can easily append each command with '', which will not
only tell me the boundary of each output but also help me remember
what command was executed. cmd1 cmd2

Since what I expect is not possible, the next solution is to use the
eval version which requires to put quote around cmd1, cmd2... But this
is very annoying, when cmd1, cmd2 themselves have the quotation marks,
I have to escape these marks.

So neither solution to is ideal, although any of them is
better than the other in certain situations.


reply via email to

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