Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: How to call Linux command sequentially

by mv.ashwin@gmail.com (Novice)
on Sep 13, 2011 at 10:26 UTC ( [id://925667]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to call Linux command sequentially
in thread How to call Linux command sequentially

Sorry if the "sequentially" word have diverted you. You are correct i want the second command to be run in the environment created by first command. Initially i will be in home dir & shell:/usr/bin/tcsh when i run the first command a envirinment will be created in "/nfs/home/akmvx/test" which was the input to first command "-ov /nfs/home/akmvx/test" same shell. There the second command should be executed. Please help.
  • Comment on Re^4: How to call Linux command sequentially

Replies are listed 'Best First'.
Re^5: How to call Linux command sequentially
by pvaldes (Chaplain) on Sep 13, 2011 at 10:34 UTC
    system ("comand1 && comand2");

    Runs for me. If you can't do this try a pipe or go to sleep

    system ("sleep 50 && touch file1");

    also run

      tried this did not work, untill i exit from command1 command2 will not execute. If i use other commands like mkdir touch all works fine but for my command above which creates the environment i will go idle untill i exit from command1(which creates an environment)

        We probably could help better if we know what exactly the first command does, and why do you need to make such thing as create a file using touch FROM a perl script

        `command 1`; open a_file;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://925667]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found