0

I am trying to give the path to a file as an argument for a script and that same argument, I am using to get the location of the particular file.

myvar1= $(basename ${1}/mydir/file*)

echo "File Name is ${myvar1}"

And trying to execute the script as

bash new.sh /home/usr/test

My file is actually as /home/usr/test/mydir/file2039.

The execution is giving an error with:

new.sh: line 1: file2039: command not found
File Name is

Can anyone suggest what is going wrong? Thanks!

Rocket9399
  • 75
  • 1
  • 7

0 Answers0