Click here to get back home

running shell command without echo in terminal

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
running shell command without echo in terminal Anand 05-21-2008
Posted by Anand on May 21, 2008, 3:50 pm
Please log in for more thread options
I want to run unix shell commands through perl script but I do not
want to echo the output of these commands on the terminal.
Is there a way in per function I can achieve this?

thanks,
Anand.

Posted by Jim Gibson on May 21, 2008, 4:08 pm
Please log in for more thread options
In article

> I want to run unix shell commands through perl script but I do not
> want to echo the output of these commands on the terminal.
> Is there a way in per function I can achieve this?

Sure. Either capture the output of the shell command by using the qx()
operator or, equivalently, backticks (`command`):

my $output = qx("command");

or by redirecting the output of the command to a file or the null
device:

system("command > /dev/null");

--
Jim Gibson

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
http://www.usenet.com

Similar ThreadsPosted
Passing a command to a process that's already running September 19, 2005, 11:09 pm
How to set environmental variables before running another command? June 3, 2008, 2:27 pm
Re: `command 2>&1 > file` without the shell? September 15, 2007, 11:17 am
Re: `command 2>&1 > file` without the shell? September 15, 2007, 11:20 am
Re: `command 2>&1 > file` without the shell? September 16, 2007, 6:23 am
`command 2>&1 > file` without the shell? September 15, 2007, 11:10 am
Trouble running a unix command with a subroutine call November 24, 2005, 7:03 am
problem running grep within system command in perl March 19, 2006, 12:53 pm
How to get an exit code from a 'shell' command ? December 6, 2005, 3:01 am
Perl variable to shell command...? September 4, 2007, 5:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap