I’m creating a script that is supposed to create jobs on a HPC (cluster). I have created a function that gets 4 variables and create a string from them:
startJob (){
if [ $per -lt 10 ]; then
folder=/storage/users/avityo/prog/0$1.$2$3
else
folder=/storage/users/avityo/prog/$1.$2$3
fi
echo $folder
}
In the result I get from this, there is a separation by commas
/storage/users/avityo/prog/00,.583,bfd,
How can I remove these commas?
Edit:
Judging from the answers and comment I got, I should have mentioned how I call this function I have realized I’m not calling the function in the right way. I was using this:
let count=0
for per in $(seq 70 -5 0); do
for seed in {580..583}; do
for c in {"fs","fd","bfs","bfd"}; do
let count=$count+1
startJob $per, $seed, $c, $count
done
done
done
removing the commas when calling the function fixed this.
It looks like you are calling your function like this:
You don’t need the commas; the arguments are only separated by whitespace. Try this: