If you are not able to parse the output to find the variables (which should be possible - can you show an example values?), you can save each variable to its own file and then retrieve the values from the files.
| [reply] |
Thank you for your fast reply!
The perl script generates yesterdays date, saves it in $day $month and $year and prints these 3 variables.
I can use this date as one string, that is no problem.
But the perl script also has the variable $counter which is also printed.
The final output looks like this:
print "Backup date: $day\.$month\.$year\n";
print "$counter files have been successfully saved.\n";
I need to use the date and the $counter value in bash. | [reply] [d/l] |
You can save the output to a bash array to easily access the values:
out=($(script.pl))
date=${out[2]}
counter=${out[3]}
| [reply] [d/l] |
print "counter=$counter files have been successfully saved.\n";
In bash capture value assign after "counter=" string..
| [reply] [d/l] |