![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl CGI Scripts | cb.mark | High Level Programming | 1 | 11-23-2006 06:56 AM |
| Running shell scripts automatically without using Batch or at commands | ritzwan0 | Shell Programming and Scripting | 3 | 09-17-2006 11:51 AM |
| Unix commands in perl script | athri | UNIX for Dummies Questions & Answers | 1 | 07-14-2006 06:31 AM |
| Perl calling unix system commands | new2ss | Shell Programming and Scripting | 4 | 04-05-2006 06:32 PM |
| Replace Perl Module name in all Perl scripts | rahulrathod | Shell Programming and Scripting | 2 | 12-01-2005 09:00 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
[PERL] Running unix commands within Perl Scripts
I understand that in order to run basic unix commands I would normally type at the prompt, I would have to use the following format
Code:
system(ls -l); or exec(ls -l); |
| Forum Sponsor | ||
|
|
|
|||
|
system calls
To learn more about the perl system function, at your command line type
perldoc -f system (to learn more about using perldoc, type 'man perldoc' at the command prompt). Your problem is that system() is expecting a LIST of things you want done. You are providing it with two items which aren't even separated by a comma, so Perl is going crazy trying to figure out what you want. Try system("ls -l") to provide system() with just one thing you want it to do. Same with exec. Be sure to perldoc -f exec to discover the differences between these two commands. |
|||
| Google UNIX.COM |