A second error is
You certainly want
like you did in the outer loop.
But this is not ideal for many reasons. A more efficient and less risky version:
(NB HP-UX find does not have -ls)
I have a script that has the following command:
find /home/user -name test.dat
The script works as desired when running normally. However, when I run the script preceding it with 'sh', it fails. Is there something I need to account for when preceding the execution of the script with 'sh'? (1 Reply)
I am running shell scripts on windows using Cygwin tool.
In my shell scripts, i want to add an error check, that verify whether a certain command is available or not.
For example if SED comamnd is not available in Cygwin, then it should exit with error message.
How do i write such shell... (2 Replies)
Hi all does find command return anything if the file to be searched is not found? Like if I search from a file in a dir does it return false or null if the file is not found? Please suggests. (3 Replies)
I have a sun4u system running Solaris 8. I tried running the df command but it returns a blank result. Also I'm unable to collect an explorer from this system as the OS complains that the disk is full. What could be going on here? (10 Replies)
Hello
I have a script which emails identifies the user ID of a user and sends them an email. A user can enter part of the name of the person he/wants to send the email to. Then I use the ypcat command to identify the UID of that person.
The problem I'm having, is building in an error trap... (1 Reply)
hi
I am a newbee in Shell scripting (hardly 7 days)
I have to execute a shell script which looks like this
#!/bin/sh
var1=`date +"%Y%m%d"`
echo $var1
find . -name "$var1*" -exec mv {} Delete/ \;
the find command in the script is running independently but when kept in this script it is... (24 Replies)
Hello all,
Something strange going on with a shell script I'm writing. It's trying to write a list of files that it finds in a given directory to another file. But I also have a skip list so matching files that are in that skip list should be, well uhm, skipped :)
Here's the code of my... (2 Replies)
Hi all,
Please i need an explanation for the following statements
ref_file=/tmp/cleanfiles export ref_file
touch `TZ=WAT+2 date "+%Y%m%d%H%M"` $ref_file
find . ! -name . -prune -type f ! -newer $ref_file -exec store_file.sh {} \; (1 Reply)
Hi,
Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?
The scenarios is like this.
I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Hi,
I am using below code snippet to echo/display the files found
(matching a pattern from searchstring.out file) and the corresponding owner.
while read j
do
echo "Pattern to search is:- $j"
find / -name "*$j*" |\
while read k
do
echo "File found is:- $k"
owner=$(ls... (9 Replies)