0

I've done a bunch of searching and can't figure this out.

I have a bash file I am trying to create and run, but the file keeps getting saved with an @ in the last position on the permissions:

user@COMP Desktop % ls -l ./BASH.sh    
-rw-r--r--@ 1 user  staff  58 Feb 21 05:10 ./BASH.sh
user@COMP Desktop % xattr -c ./BASH.sh 
user@COMP Desktop % ls -l ./BASH.sh   
-rw-r--r--@ 1 user  staff  58 Feb 21 05:10 ./BASH.sh
user@COMP Desktop % 

No, I have not tried running it under sudo and I will not. Otherwise, matter what I do, the file refuses to execute. Any guidance here would be appreciated. I am pretty sure the issue is that silly @ symbol in the permissions is the problem but even after an hour or so of googling and trying different solutions, I have not been able to get anything to work.

1
  • It needs more x.
    – benwiggy
    Feb 21 at 13:17

2 Answers 2

2

As I was typing this @nohillside's correct answer appeared first (chmod a+x ./BASH.sh should fix the issue). Still I'll add this bit:

Those "silly" @ symbols indicate that there are extended attributes on the file. They have nothing to do with whether the program will execute or not. To see what they are (if curious) you can use

ls -lOde@ /path/to/file

or to see the actual content of the xattrs:

xattr -lx /path/to/file
1

The reason you can‘t run the bash script is the lack of „executable“ permission. Run chmod +x BASH.sh to set the executable attribute (and ./BASH.sh to execute it).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .