Bash on Fedora error on basic script

I am not able to execute bash script on Fedora. They were running on another environment. This is a sample script:

#!/usr/bin/bash
input="./data/heu/hout1"
i=1
j=0
while IFS= read -r file1
do
#Some code here
done < "$input"


#echo $j

I get an error:
bash: s.sh: command not found...

s.sh is the name of the file.

If I change the first line to

#!/bin/bash

I still get the same error. Appreciate your help.

You need to insure the script is in your path (environment).

One way ahead is to use the full path to the script. There are other ways to solve this problem as well.

Maybe post back the output of:

ls -l s.sh

.. if you need more help.

1 Like

Does the script have x (execute) permission for your current user?

Thanks, adding the current directory to Path did the trick.

1 Like
Moderator comments were removed during original forum migration.