[perl_beginner@]cat run_all.sh
if [ $1 !~/+/ ] && [ $2 !~/+/ ]; then
Number_Count_Program $1.results $2.results > $1.$2.counts
else
Number_Split_Program $1.results $2.results > $1.$2.split
fi
After I run the following command:
./run_all.sh A B
./run_all.sh: line 1: [: A: unary operator expected
Anybody advice to edit my bash script, run_all.sh ?
The purpose I write the bash script is automatic the server run "Number_Count_Program" if first and second argument key in is don't have any "+";
As long as either first or second argument got "+", it will run "Number_Split_Program".
"Number_Count_Program" and "Number_Split_Program" is an c++ program which worked well.
Thanks for any advice.
I just try your code edit.
But it seems like the script will run "Number_Count_Program" if I key in something like "./run_all.sh A+B B+C"?
What I prefer is "Number_Count_Program" is run only when both first and second argument don't have any "+".
If either first or second or both got "+", I will prefer it run "Number_Split_Program".