![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl CGI Scripts | cb.mark | High Level Programming | 1 | 11-23-2006 10:56 AM |
| Running shell scripts automatically without using Batch or at commands | ritzwan0 | Shell Programming and Scripting | 3 | 09-17-2006 02:51 PM |
| Unix commands in perl script | athri | UNIX for Dummies Questions & Answers | 1 | 07-14-2006 09:31 AM |
| Perl calling unix system commands | new2ss | Shell Programming and Scripting | 4 | 04-05-2006 09:32 PM |
| Replace Perl Module name in all Perl scripts | rahulrathod | Shell Programming and Scripting | 2 | 12-02-2005 01:00 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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); |
|
||||
|
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. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| unix commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|