So, shell is trying to find an executable file in the location:. You would run a executable script that is the current directory as. You can actually simply run the executable by using the absolute path given the script is executable :. Or even just the name of the script if the directory containing the script is in the PATH environment variable. Now if your script is Not executable , you can run it too without making it an executable by telling the shell which program will handle the script i.
When you use. Using the bash command explicitly like in bolzano's answer starts from the root directory instead of the one you're in. In addition to the other answers What you tried was almost fine But you forgot the extension. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Learn more. Problem when trying to run shell script : No such file or directory Ask Question. Asked 6 years, 9 months ago. If yes, I can't help you. A real fix instead of downgrading is double checking that you do not have multiple daemons spawned for the same network controller, in practice this often means that you have both the dhcpcd and the dhcpcd interface.
It's not entirely clear why this situation lead to this fall out, but this situation has always been warned against and is known to lead to undefined behaviour.
Atom topic feed. Arch Linux. Index Rules Search Register Login. You are not logged in. Topics: Active Unanswered. It seems like the find command stored the original results, acted on it by deleting the directory, but then tried to delete it again? Or is the -f option of rm , which is supposed to be for ignoring nonexistent files and arguments, is ignored?
I note that when I run tests with the rm command alone without the find command, everything worked as expected. Thus, directly running rm -rf Should I use the -delete option instead of the -exec rm I had wanted to make the script as broadly applicable as possible for systems that didn't have -delete option for find. Thanks for all the help so far, guys. I'll publish the script when I'm done.
I'm writing a bash script to delete a few OS X remnants on my Lubuntu file shares. However, when executing this:. Before I added the -exec rm AppleDouble directory. I'm afraid to screw too much with the -exec portion as I don't want to obliterate directories in error. When finding and deleting directories with find, you'll often encounter this error because find stores the directory to process subdirectories, then deletes it with exec , then tries to traverse the subdirectories which no longer exist.
You can either pass -maxdepth 0 or -prune to prevent this issue. Like so:. You don't need to escape DOT in shell glob as this is not regex. So use. AppleDouble :. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more.
0コメント