This is my first time started to write an executable bash script.
I have four command lines that I want to put in a .sh file then to run on a single csv file.
I want to avoid a single long line of commands e.g. command1 | command2 | command3 | command4
instead, I need either save intermediate outputs inside temporary variables or use something instead of pipe.
I tried this but it doesn't give proper output:
filename="$2"
outputname="$3"
if [[ $1 = "-u" ]]; then
out= cut -f1,3,7,8 "${filename}" | grep "*_11_0" | tr , ':'
out2= awk '{print $1,$2}' "${out}"
echo "${out}"
else
echo "Error: You have to specify an option"
fi