I want to run multiple commands in the same line after the previous is done.
I do the following bellow in a python script:
os.system("start_view myView && perl /home/user/Development/count_test.pl -rev 001 -project myproject && /usr/bin/python /home/user/Development/setDoneFlag_Count_Lines.py")
First I set a view in clearcase start_view myview, then I want to execute a perl program. Problem is it doesn't, it just sets the view (which I need in order for me to execute the perl program) but it never actually starts the perl program, so the question is am I doing anything wrong? It seems like start_view myView starts a new shell, so how do I execute a perl script in the newly created shell that the view starts?
Thanks in advance.
start_view, since we can only guess…;instead of&&? Perhaps the first command returns unsuccessfully.start_viewis starting a new shell, it may simply not be returning. Perhapsstart_viewtakes an option to allow it to start a process in the shell that it creates.start_viewwill have an option (e.g.-c) where you can give it a command to run in the shell that has been launched in the view's context; if it exists, move the rest of your command into there. Additionally,&&short-circuits upon failure (i.e. non-zero status), but;does not (i.e. each command runs in succession). You can also do||for reverse short-circuit (i.e. execute only if there's a failure). For example try:/bin/true && echo TRUE || echo FALSEand/bin/false && echo TRUE || echo FALSEstartview? Maybe you wantsetview -c your_commands_here? setview doc