10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In a fastload teradata utility I am trying to delete the files which are older than 30days using the find and rm command as following.
find . -name 'xxx_*' -mtime +30 -exec rm -f {} \;
I expect it to delete all the files older than 30 days but sometimes it gives an error : find: bad status--... (3 Replies)
Discussion started by: stelkar
3 Replies
2. UNIX for Dummies Questions & Answers
when I run the following command in AIX (bash),
find ./*
I get the following error.
find: bad status-- ./*
Thats becasuse, its an empty directory. The same works, when there the directory is not empty. Even though the find deesnt have to rerun any result.
My full find command would look... (4 Replies)
Discussion started by: deepakwins
4 Replies
3. Shell Programming and Scripting
I have the following code in a script:
find . \( ! -name . -prune \) -name "cg*" -exec cp -p {} "${temp_dir}" \;
ret_stat=$?
I think the return status is only captured for the 'find' command and not for the 'cp' command. Is there a way to get the return status for the 'cp' command... (7 Replies)
Discussion started by: vskr72
7 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Discussion started by: Ariean
6 Replies
5. 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
6. Programming
Hi All,
First of all thanks for reading this post.
In my application, I am trying to create a new message queue . I am attaching the code below.
mqd_t mqopen2(const char * pName,
unsigned long Flags,
long maxMsg,
long msgSz)
{... (15 Replies)
Discussion started by: parusasi
15 Replies
7. Shell Programming and Scripting
Hello gurus,
Tired of using $? to view the execution status of the previous command.
how can I get the status directly?
definitely this is not working,
if ]
then
fi (6 Replies)
Discussion started by: biglau
6 Replies
8. 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
9. UNIX for Advanced & Expert Users
I am looking for all the header files (*.h).. which as per documentation of the UNIX system shouldbe there.
I am using
find / -name *.h -print
But it does't give anything.
My question is under what condition the "find" condition will fail to find the file?
What is the work around.
... (4 Replies)
Discussion started by: rraajjiibb
4 Replies
10. 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