in reply to Running Multiple Commands using System

Have you printed the actual string that you are passing to system?

my $cmd= 'sdb -d root on'; system($cmd)== 0 or die "Couldn't launch [$cmd]: $! / $?";

Most likely there is some (lack of) shell quoting going on, but it's hard to say without seeing the relevant parts of your code.

Replies are listed 'Best First'.
Re^2: Running Multiple Commands using System
by dkhoriya (Initiate) on Jun 27, 2014 at 06:49 UTC
    Update: I am not using just a single shell command in System but multiple.
    system("sdb -d root on");
    works fine but using multiple commands in single system call like
    system("sdb -d root on 'sdb -d shell; ls'; ");
    doesn't work.

      Does using multiple commands work outside of Perl?

        system will create a child owning another terminal different from parent and while the execution of command is finished, the handle is returned to the parent. So the question you asked is not relevant here. Outside perl, I can make multiple commands run in series one by one without caring but while running from perl, in the same child terminal I have to execute multiple serial commands. If I use another system call for a second command then a new child terminal is created and the previous handle is gone. Hence no use.