Computing.Net > Forums > Linux > How to escape the 'pipe' command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to escape the 'pipe' command

Reply to Message Icon

Name: Peter
Date: March 11, 2002 at 16:23:49 Pacific
Comment:

How do I evaluate a command that is stored within a variable ?

I have the following script:
#!/bin/sh
my_func_call=ls -l | more
echo "Evaluating $my_func_call"
$my_func_call

I tried placing single quotes (', not `) arount the statement. When my call is only ls -l, all it fine. The problem is that the pipe and the more is translated as a directory ?

I would very much appreciate by email. I will post the answer after figuring it out. Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: mic_HL
Date: March 12, 2002 at 08:53:11 Pacific
Reply:

#!/bin/sh

my_func_call=`ls -l | more`
echo "evaluating $my_func_call"


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: How to escape the 'pipe' command

How to work the Crontab command? www.computing.net/answers/linux/how-to-work-the-crontab-command/24205.html

How To Edit the Sudoers file www.computing.net/answers/linux/how-to-edit-the-sudoers-file/24183.html

How to make the cursor blin? www.computing.net/answers/linux/how-to-make-the-cursor-blin/16058.html