command not available in bash script Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of command not available in bash script without wasting too much if your time.

The question is published on by Tutorial Guruji team.

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


for file in ./folder/*
  oTools upload $file

But I’m having the following error:

./ 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?


When you write a script, it doesn’t typically pull in your aliases.

You might consider specifying the command explicitly in your script:

for file in ./folder/*
    ${oTools} upload "${file}"
We are here to answer your question about command not available in bash script - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji