faqts : Computers : Programming : Languages : PHP : Common Problems : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 20 people (80%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I execute multiple unix commands with one system call?

Sep 15th, 1999 21:51
Nathan Wallace, John Millaway, Richard Lynch, Teodor Cimpoesu


Try this:

    system("cd /etc ; ls -l");

or this:

    chdir("/etc");
    system("ls -l");

or this:

    system("cd /etc \n ls -l");

or these bash variations:

    system("ls -l /etc");

    system("cd /etc && ls -l");