"su: authentication failure" after attempting to fix "bash: bad interpreter: Permission denied" error
I'm trying to learn bash shell scripting, and I've run into a series of related issues. I can't execute the
Code:
mkfile.sh Code:
[austin@archlinux bash]$ ./mkfile.sh filetocreatetext.txt 'line to put in file' Code:
su Quote:
Code:
sudo su Would it even be possible to reset my root password using Code:
sudo su Code:
austin |
The two errors are unrelated to each other. The bad interpreter is probably due to a bad shebang line i.e. #!/bin/bash. Without seeing your script it is difficult to say what is wrong. Did you write the script using windows and copied to linux?
|
Quote:
Code:
mkfile.sh Code:
/home/austin/bash Code:
#!/home/austin/bash Is the shebang line wrong? I've used an identical line for every script I've written so far, located at Code:
home/austin/bash No Windows computer was involved in the construction/copying of this script or any files; all of this was done on my Arch Linux laptop. |
Quote:
/home/austin/bash is a directory and thus not an interpreter. |
Quote:
That seems to have done the trick (I don't get an error message anymore); I changed the shebang to Code:
#!/usr/bin/bash Code:
[austin@archlinux bash]$ ./mkfile.sh file-to-create.txt line to put in file |
just a comment: you must not use sudo and su together, that is not a good advice.
|
That entire "mkfile.sh" script is plain stupid - if the rest of the guide uses similar examples, I'd recommend a different guide.
Here's one: https://mywiki.wooledge.org/BashGuide |
Quote:
|
All times are GMT -5. The time now is 01:28 PM. |