http://qs1969.pair.com?node_id=11136213


in reply to Automating execution of shell scripts

As I understand your problem, you have two shell scripts which you must use "as is". You want a perl program to automate this procedure. For each argument, run script1 which computes a directory name and creates that directory, then run script2 in that directory. Your question is how can your perl program get the name of directory it needs to run script2.

You tell us that script1 " prints in the terminal the path to the created dir." You should be able to capture that output if you run script1 with backticks. my $script_output = `script1`'. You can change the working directory with the function chdir. You may need the module Cwd to get the directory you want to return to.

Bill