BASH question: executing a cmd with a pipe that is in a variable

Bruce Dawson jbd at codemeta.com
Tue Aug 9 15:26:01 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Larry Cook wrote:

| I'm being stupid!  Can someone please help?
|
| I've got a BASH script with the following:
|
| CMD="zcat myfile | tar xf -" $CMD

You want "eval $CMD".

| This puts zcat's output to stdout, rather than piping it to tar
| like I want. Now I'm sure this is how it *should* work. :-(
| Unfortunately, I can't figure out how to get it to work like I
| want.
|
| Thanks, Larry _______________________________________________
| gnhlug-discuss mailing list gnhlug-discuss at mail.gnhlug.org
| http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC+QMb/TBScWXa5IgRAgzRAJ9PtQgS0fleT2oKzQJPGNPBCn7oMwCeMjnn
QSjEvIb2nvDUlMDVrCyYJmM=
=1VpX
-----END PGP SIGNATURE-----




More information about the gnhlug-discuss mailing list