LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2018, 04:13 PM   #1
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Rep: Reputation: Disabled
Cannot execute bash script -command not found


I have been forced to "update" my OS and in the process almost lost my work.
I have been working on this for about a months and learning how to write bash script.

I have recovered all my code and attempted to continue work.
The "problem " is - I can edit , using nano editor, but cannot execute the file. I did change the file mode, but it did not help.

Perhaps I am forgetting some bash installation in my "new " OS.

pi@pi:/media/pi/WORK $ ls
lost+found raspi-config raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo nano raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo chmod +x raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo raspi-config_DEBUG.sh
sudo: raspi-config_DEBUG.sh: command not found
pi@pi:/media/pi/WORK $
 
Old 10-07-2018, 04:23 PM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,121

Rep: Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598Reputation: 1598
Quote:
Originally Posted by Jim232 View Post
I have been forced to "update" my OS and in the process almost lost my work.
I have been working on this for about a months and learning how to write bash script.

I have recovered all my code and attempted to continue work.
The "problem " is - I can edit , using nano editor, but cannot execute the file. I did change the file mode, but it did not help.

Perhaps I am forgetting some bash installation in my "new " OS.

pi@pi:/media/pi/WORK $ ls
lost+found raspi-config raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo nano raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo chmod +x raspi-config-DEBUG.sh
pi@pi:/media/pi/WORK $ sudo raspi-config_DEBUG.sh
sudo: raspi-config_DEBUG.sh: command not found
pi@pi:/media/pi/WORK $
Unless the script is in your $PATH, you would need to use the "./" in front of the script's filename.

For example,

Code:
sudo ./raspi-config_DEBUG.sh
 
1 members found this post helpful.
Old 10-07-2018, 04:29 PM   #3
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
SOLVED

Thanks
 
  


Reply

Tags
bash


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script to extract the values and as execute in command jmishal Programming 1 03-29-2018 01:08 AM
[SOLVED] execute VI command from bash script goillini Linux - Server 3 07-03-2013 02:45 PM
BASH Script - command not found!! JavaNinja Linux - Newbie 12 12-01-2008 11:45 AM
Execute command with spaces from variable in bash script klo_2k Linux - Newbie 4 04-13-2008 02:59 AM
Bash script says command not found - why? RavenLX Ubuntu 3 08-03-2007 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration