06-03-2013
That is expected behavior of find command.
It returns 0 if all path operands were traversed successfully.
It returns a non-zero exit status only if there is an error occurred.
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I want to find the exit status of the last executed command in C Shell.
Tried $? but getting the error Variable syntax...$? does not seem to work in C shell..
is there any other command in C shell to find the exit status of last command?
Thanks in advance,
raju (1 Reply)
Discussion started by: rajugp1
1 Replies
2. UNIX for Dummies Questions & Answers
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies
3. Shell Programming and Scripting
Hi to everyone.
How can I get the exit status from a remote command executed with rexec? :eek:
machine A has RedHat Linux 9 and the remote machine B has SCO UNIX.
Code:
rexec -l user -p password host sh /u/files/scripts/seq_cal.sh 2006 08
I want the exit status returned by... (1 Reply)
Discussion started by: zoonalex
1 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (1 Reply)
Discussion started by: visingha
1 Replies
5. Shell Programming and Scripting
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (10 Replies)
Discussion started by: visingha
10 Replies
6. Shell Programming and Scripting
Hi All
Its strange or i am doing it wrong.When find run successful it return exit status 0.And same if it didn't run successfully it return zero.
find /var/www/html -maxdepth 1 -type f -name *.dsadas
echo $?
0
find /var/www/html -maxdepth 1 -type f -name *.php... (1 Reply)
Discussion started by: aliahsan81
1 Replies
7. HP-UX
I have noticed that on version 11.23 I get exit status 236 from the
following command:
logins -oxl root ; echo $?
> 236
However on 11.31 I get the expected code 0
logins -oxl root ; echo $?
> 0
The output is correct for both versions and contains no error data.
Can anyone explain... (2 Replies)
Discussion started by: parkea2
2 Replies
8. UNIX for Advanced & Expert Users
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies
9. Shell Programming and Scripting
Lois_Answer_Code=`sipsak -vv -s sip:192.168.1.3|grep -A 1 "reply received after"|grep SIP|awk '{print $2}'`How to find the exit status of | (12 Replies)
Discussion started by: proactiveaditya
12 Replies
10. Shell Programming and Scripting
Hi All,
I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest.
Thanks,
Mani (1 Reply)
Discussion started by: pvmanikandan
1 Replies
LEARN ABOUT DEBIAN
file::find::wanted
Wanted(3pm) User Contributed Perl Documentation Wanted(3pm)
NAME
File::Find::Wanted - More obvious wrapper around File::Find
VERSION
Version 1.00
SYNOPSIS
File::Find is a great module, except that it doesn't actually find anything. Its "find()" function walks a directory tree and calls a
callback function. Unfortunately, the callback function is deceptively called "wanted", which implies that it should return a boolean
saying whether you want the file. That's not how it works.
Most of the time you call "find()", you just want to build a list of files. There are other modules that do this for you, most notably
Richard Clamp's great File::Find::Rule, but in many cases, it's overkill, and you need to learn a new syntax.
With the "find_wanted" function, you supply a callback sub and a list of starting directories, but the sub actually should return a boolean
saying whether you want the file in your list or not.
To get a list of all files ending in .jpg:
my @files = find_wanted( sub { -f && /.jpg$/ }, $dir );
For a list of all directories that are not CVS or .svn:
my @files = find_wanted( sub { -d && !/^(CVS|.svn)$/ }, $dir ) );
It's easy, direct, and simple.
WHY DO THIS
?
The cynical may say "that's just the same as doing this":
my @files;
find( sub { push @files, $File::Find::name if -f && /.jpg$/ }, $dir );
Sure it is, but File::Find::Wanted makes it more obvious, and saves a line of code. That's worth it to me. I'd like it if find_wanted()
made its way into the File::Find distro, but for now, this will do.
FUNCTIONS
find_wanted( &wanted, @directories )
Descends through @directories, calling the wanted function as it finds each file. The function returns a list of all the files and
directories for which the wanted function returned a true value.
This is just a wrapper around "File::Find::find()". See File::Find for details on how to modify its behavior.
COPYRIGHT & LICENSE
Copyright 2005-2012 Andy Lester.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0.
perl v5.14.2 2012-06-08 Wanted(3pm)