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 function:
I've added an echo ${SEARCHT_STMT} for debugging reasons.
It shows me following output
When I execute this on the command line it works just fine. I get a nice list of files in that directory that have modified within the last 10 days.
However when I call this function in my script I get following error:
Can anyone help me here? How's it possible that when I just run the line it works but from my script it doesn't?
Hello
I have a shell script that is run as root. Script rins ok until the point where it have to switch to user "mqm" to run other commands. It just hangs at the point of this line in the script
su - mqm -c "dspmq"
I ran the same commands at the terminal and they run fine.
Any thoughts. (6 Replies)
Hi All,
I am using below snippet to search for a string (read from a file 'searchstring.out') in all locations (/) and then iterate over the files found to write the locations and the respective owner to an output file.
However, this doesn't work as I believe the find command doesn't exit's... (11 Replies)
I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated
server1$ logutility logtype
When I run... (8 Replies)
Linux version : Oracle Linux 6.4
Shell : Bash
The following script will be run as root. During the execution, it should switch to oracle user and execute few commands.
After googling and searching within unix.com , I came up with the following syntax
## Enclosing all commands in double... (7 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Using solaris 2.5.1, and how can I get a summary of the size of each subdirectory, say for /export/home, all the users? usually I do a du -sk dirname but I have to manually type in each name, is there a better way?
Thanks, (3 Replies)
Hello,
I'm stuck and confused as to why when I execute things form the command line it works but when in a script it doesn't.
My script:
### creating a lock on the console
touch /var/run/console.lock
chmod 600 /var/run/console.lock
echo "$User" >>... (2 Replies)
I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong.
When I copy and paste it to the terminal, it is OK. Any idea what the problem might be?
set i = `grep -c #define flags.h`
while ($i>20)
@ i--
my func (`cat... (4 Replies)