help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] storing a command in a variable


From: Greg Wooledge
Subject: Re: [Help-bash] storing a command in a variable
Date: Mon, 15 Apr 2013 08:30:02 -0400
User-agent: Mutt/1.4.2.3i

On Sat, Apr 13, 2013 at 01:47:58AM +0200, John Kearney wrote:
> I normally advise
> 
> run_cmd() {
>     local RValue=0
>     printf "%q" "address@hidden"; echo
>     "address@hidden" || RValue=$?
>     [ ${RValue} = 0  ] || echo "Returned (${RValue}) ${*}"
>     return ${RValue}
> }
> 
> run_cmd command arg

The problem is that you can only run simple commands this way --
no pipelines, no compound commands.



reply via email to

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