My company has a custom tool we install in Linux to upload files to a server (among other things) called oTools. When I open a new Terminal, I can run (from any folder) oTools upload file and file is uploaded to the server.
However, the tool doesn't have an option to upload several files at once. So I'm trying to build a bash script to do that. Here is the code I built
#!/bin/sh
for file in ./folder/*
do
  oTools upload $file
done
But I'm having the following error:
./upload-all.sh: oTools: not found
I've checked my file .bashrc and it contains the path to oTools:
alias oTools="/home/user/folder/oTools-cli"
I've tried also to put the complete path on my script (the path above, that is on .bashrc file), but I'm getting the same issue. I tried doing the same code using ls instead of my installed tool and it worked...
So, how can I make bash script to recognize my custom tool?
"$file"when you use it. Otherwise your code will break unexpectedly when you use a filename that contains a character special to the shell.