- or download this
return1=`/path/to/script.pl arg1 arg2`
return2=$(/path/to/script.pl arg1 arg2)
- or download this
return_newlines="$(/path/to/script.pl arg1 arg2)"
- or download this
#!/usr/bin/perl
print $_, $/ for @ARGV;
- or download this
#!/bin/bash
value=0
...
echo "value is $value"
done <<<"$(./script.pl arg1 arg2)"
echo "finally, value is $value"
- or download this
value starts from 0
value is arg1
...
value is arg1
value is arg2
finally, value is arg2