[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.
- [Help-bash] storing a command in a variable, lxnf98mm, 2013/04/12
- Re: [Help-bash] storing a command in a variable, Roman Rakus, 2013/04/12
- Re: [Help-bash] storing a command in a variable, Greg Wooledge, 2013/04/12
- Re: [Help-bash] storing a command in a variable, Dan Douglas, 2013/04/12
- Re: [Help-bash] storing a command in a variable, Bob Proulx, 2013/04/12
- Re: [Help-bash] storing a command in a variable, John Kearney, 2013/04/12
- Re: [Help-bash] storing a command in a variable,
Greg Wooledge <=