I'm trying to run the following command on bash:
Active4 years, 5 months ago
Apr 19, 2018 Hello,i get a problem exec '/system/bin/sh' failed: No such file or directory (2) when i root and unlock bootloader i try to upgrade rom from 2.3.7 to ics when i try to unlock bootloader get the problem, so i cannot process change kernal. Someone told me try root my phone again to solve this problem. I follow and get this, same problem to. Besides moving executables to an early-accessible location (which is anyway a good thing to do), it is possible specify mount dependencies to tell systemd to delay start-up of your unit until after the location is mounted and available. Problem when trying to run shell script: No such file or directory. Ask Question. When you use./ to execute a file, it will look in the current folder (.) for a folder named home instead of starting from the root (/) directory. Errno 2 no such file or directory. Jun 09, 2014 sound to me that bzip2 is not installed on your system. Check for the command bzip2 if you can find it, install it on Debian (or ubuntu) with.
Unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1 #418. Closed arprasto opened this issue Mar 23, 2018 6 comments Closed unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1 #418.
which is giving me a
rvm is a bash file, and it does run ok when I attempt to run it from its own folder (production_x86_64-linux ). It works also fine if I attempt to run it when opening the terminal in its parent folder, for instance, or even its parent-parent folder.
I've run it over with
dos2unix just in case and I've also checked its executing permissions, which seem to be fine.
What am I missing here?
devoured elysiumdevoured elysium
3 Answers
you can run a bash script by using the following command
in your case
it will work
what basically the . means is your current directory location.
if you are under your
<user> folder then try doing this
it will work but first you should make the file executable using the following command
bolzanobolzano
While you are trying:
shell will always treat
. in front of a path as current directory and hence the path will always be a relative path. So, shell is trying to find an executable file in the location:
which is wrong as you can see. You would run a executable script that is the current directory as
./script.sh .
You can actually simply run the executable by using the absolute path (given the script is executable):
Or as
~ is expaneded by shell as $HOME :
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.e. giving the script as an argument to heemaylheemayl
bash (shell):
71.1k1111 gold badges153153 silver badges222222 bronze badges
When you use
./ to execute a file, it will look in the current folder (. ) for a folder named home instead of starting from the root (/ ) directory.
Using the
bash command explicitly like in bolzano's answer starts from the root directory instead of the one you're in.
To use the command without
bash you could enter
or
from your home directory assuming it is marked executable.
RobobenkleinRobobenklein
Not the answer you're looking for? Browse other questions tagged bashscripts or ask your own question.
Active11 months ago
![]()
I was installing a binary Linux application on Ubuntu 9.10 x86_64. The app shipped with an old version of gzip (1.2.4), that was compiled for a much older kernel:
I wasn't able to execute this program. If I tried, this happened:
ldd was similarly unhappy with this binary:
I'm curious: What's the most likely source of this problem? A corrupted file? Or a binary incompatibility due to being built for a much older {kernel,libc,...}?
Per nos's suggestsions, here's the output of
strace ./gzip :
Here's the output of xpt
readelf -a ./gzip :
5,2021212 gold badges3838 silver badges9292 bronze badges
Lorin HochsteinLorin Hochstein
37.7k2424 gold badges8787 silver badges126126 bronze badges
8 Answers
The answer is in this line of the output of
readelf -a in the original question
I was missing the /lib/ld-linux.so.2 file, which is needed to run 32-bit apps. The Ubuntu package that has this file is libc6-i386.
Lorin HochsteinLorin Hochstein
37.7k2424 gold badges8787 silver badges126126 bronze badges
You get this error when you try to run a 32-bit build on your 64-bit Linux.
Also contrast what
file had to say on the binary you tried (ie: 32-bit) with what you get for your /bin/gzip :
which is what I get on Ubuntu 9.10 for amd64 aka x86_64.
Edit: Your expanded post shows that as the Dirk EddelbuettelDirk Eddelbuettel
readelf output also reflects a 32-bit build.
293k4242 gold badges543543 silver badges627627 bronze badges
Old question, but hopefully this'll help someone else.
In my case I was using a toolchain on Ubuntu 12.04 that was built on Ubuntu 10.04 (requires GCC 4.1 to build). As most of the libraries have moved to multiarch dirs, it couldn't find ld.so. So, make a symlink for it.
Check required path:
Create symlink:
If you're on 32bit, it'll be i386-linux-gnu and not x86_64-linux-gnu.
AnonAnon
Rm No Such File Or Directory
I think you're x86-64 install does not have the i386 runtime linker. The ENOENT is probably due to the OS looking for something like /lib/ld.so.1 or similar. This is typically part of the 32-bit glibc runtime, and while I'm not directly familiar with Ubuntu, I would assume they have some sort of 32-bit compatibility package to install. Fortunately gzip only depends on the C library, so that's probably all you'll need to install.
karunskikarunski
leesagaciousleesagacious
It is possible that the executable is statically linked and that is why
ldd gzip does not see any links - because it isn't. I don't know much about things that far back so I don't know if there would be incompatibilities if libraries are linked in statically. I might expect there to be.
I know it's the most obvious thing going and I'm sure you've done it, but
chmod +x ./gzip , yes? No such file or directory is a classic symptom of that not being done, that's why I mention it.
user257111
I also had problems because my program interpreter was /lib/ld-linux.so.2 however it was on an embedded device, so I solved the problem by asking gcc to use ls-uClibc instead as follows:
Velizar HristovVelizar Hristov
Well another possible cause of this can be simple line break at end of each line and shebang lineIf you have been coding in windows IDE its possible that windows has added its own line break at the end of each line and when you try to run it on linux the line break cause problems
Gradle Exec No Such File Or Directory
AmirAmir
Not the answer you're looking for? Browse other questions tagged linux or ask your own question.Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |