Monday, April 29, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2089  / 1 Year ago, sat, january 21, 2023, 8:29:56

Why doesn't Ubuntu support sh example.sh command?


It's more convenient than cd $wd; ./example.sh and add PATH in some situation.


login.sh:


~/bin/logmitgw.sh -i 4564646 dfdsfsdf

logmitgw.sh:


some code

When I'm running sh ~/bin/login.sh


I get:


sh: 0: Can't open ~/bin/login.sh

ls -l ~/bin/login.sh outputs -rwxrwxr-x


More From » command-line

 Answers
1

If the script is in ~/bin then ~/bin will already be in the path. As long as it's a bash script you can execute it from anywhere at all. No need to shell, no need to cd, and no need to add anything in your path.



eg:



login.sh

[#34214] Monday, January 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edgehogight

Total Points: 272
Total Questions: 113
Total Answers: 99

Location: Northern Mariana Islands
Member since Sun, Jul 19, 2020
4 Years ago
edgehogight questions
Sat, Sep 11, 21, 22:09, 3 Years ago
Sat, Nov 6, 21, 19:48, 3 Years ago
Fri, Aug 26, 22, 09:37, 2 Years ago
;