What is wrong with this system "..." command?

V

Victor

I am getting error with following code when run unix:

!system "ls >& log" or die "cant run";

error:
sh: log: bad number
cant run at test.pl line 3.

Though it works on Linux!

Thanks,
--V
 
C

Chris Mattern

Victor said:
I am getting error with following code when run unix:

!system "ls >& log" or die "cant run";

error:
sh: log: bad number
cant run at test.pl line 3.

Though it works on Linux!
As the error message indicates, system is trying to parse
your command line with sh, so your csh syntax is not working.
Try "ls >log 2>&1"

Chris Mattern
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top