Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

re: calling a UNIX command in a perl script

Status
Not open for further replies.

thutmose

MIS
Mar 31, 2002
24
0
0
US
Hi,



This is a very basic question for a basic starter perl scripter.


for ( $count=1; $count<=12; $count++ )


{ How do I call a unix command here thanks
 
It really depends on what you want to do with the command. If you just want to execute some command and don't need to get any output, then you can use the system command. The syntax is like:

system(&quot;command here&quot;);

If you need output then you can do something like this using backticks.

$output=`command here`;

Now $output has the results of the command.

Also check out the &quot;exec&quot; function in the perl documentation.

MattMcGinnis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top