I'm quite surprised by the following behavior of find.
How can I make sure find fails if it cannot list all files and folders?
Thanks in advance
Santiago
Those are strange results. What operating system are you using?
Note that the results I would expect from a readable, unsearchable directory vary depending on whether or not there are any files (other than . and ..) in that directory. The find utility can find all of the files in a directory even if it is unsearchable, so if there aren't any files in that unsearchable directory, there is no reason for find to fail. But, if files are present in an unsearchable directory, find won't be able to stat() those files to determine if they are directories that also need to be searched (so it should fail).
But, if a directory is unreadable, the find utility can't determine whether or not there are any files in that directory (so it should fail).
The BSD-based find utility on OS X behaves as I expect. I don't have other versions of find readily available to test against my expectations.
How to get exit value of an executable that gets called from function?
I have an executable called “myexec” which returns 0 on success and different values for different fail scenarios.
I need to call this (myexec) executable from “myprog()” function of other executable and get the exit value... (1 Reply)
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
This may be a dumb question (but this is the UNIX for Dummies Q&A forum :)
But I'm wondering, what is the purpose of a directory being given execute permissions? I can't execute a directory, only files, right? If I make a directory executable, the files inside still won't execute unless I give... (1 Reply)
I want to put a exit if there is no file found.
In the directory I can have multiple txt files with EPISGCHGS as prefix or maynot have one.
When I am trying the following it is erroring if there is no text file with the EPISGCHGS as prefix.
for file in EPISGCHGS*.txt
do
cat $file >... (2 Replies)
i have a directory in which there are executable files and these files are added at runtime. now i need a shell script which will be called at a certain interval. this shell script should find the latest executable file in that directory and start that executable. care should be taken that once the... (6 Replies)
Dear all
I want to create a tar file which contains all executable files in a specific directory
cd /appl/home/
file some_exe
some_exe: 64-bit XCOFF executable or object module not stripped
My current approach is to tar it one by one
tar -cvf test.tar exefile1
tar -uvf test.tar... (2 Replies)
Hi,
I have an executable file that has a rather long and tedious process to complete. How would I launch the executable using the shell, and then exit the shell while leaving the executable to run in the background? (1 Reply)
Hi guys,
Can you please help me print all the executable files of a directory(in this case /home) using grep?
All i know is that this command should do it but it doesnt...
ls -l ~ | grep -..x
it shows me the following mesage
grep: invalid option -- '.'
Χρήση: grep ... ΥΠΟΔΕΙΓΜΑ ... (3 Replies)
Hello,
I have several hundred subdirectories which contain input files for a binary executable. I need to get into each of the subdirectories, run the executable and then move to the next one and repeat the process. What is the best way to do this?
Arbitrarily my file structures look like... (3 Replies)
Hi,
I have a very puzzling problem. I have a binary file, it is executable but it says "No such file or directory" when I try to run it :
root@debian:~# ls -l bmcfwul
-rwxr-xr-t 1 root root 762808 Mar 11 2010 bmcfwul
root@debian:~# ./bmcfwul
-su: ./bmcfwul: No such file or directory... (9 Replies)