0

I apologize if this question has been answered before. The search terms I could come up with were just too generic to be useful.

In a bash script, I want a parameter to be part of a path. The script says:

P=$1
sudo cp ~/work/niagara-root.1/build/$P/linux/vmlinux.64 /tftpboot/

I am invoking it with:

sh ~/.cpftp.sh TAF-2948-im

And I am getting the following error:

/home/meirs/.cpftp.sh: 5: /home/meirs/.cpftp.sh: /home/meirs: Permission denied

Just to clarify: the script itself has execute permission.

Now when I do it manually at the shell prompt, namely:

P=TAF-2948-im
cp ~/work/niagara-root.1/build/$P/linux/vmlinux.64 /tftpboot/

It works without a hitch.

What am I missing?

Thank you, one and all

Meir Shani

user3457334
  • 171
  • 2
  • 5

0 Answers0