10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to write a Unix script that will go to a specific directory (/tmp/Sanbox/logs) and tar.gz all the log files in that directory and delete the original files that are older than 2 days. So far I have this but it doesn't work. Any help would be appreciated.
#!/bin/bash
... (7 Replies)
Discussion started by: Loc
7 Replies
2. Shell Programming and Scripting
I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory.
So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine.
However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies
3. Shell Programming and Scripting
I need a script which should watch a directory for a file with specific directory.
If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column.
The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies
4. Shell Programming and Scripting
I'm looking for a script which outputs the list of directories and sub directories from root level consisting of specific files. For instance I want shell script to list all the directories and subdirectories containing .txt files.:wall: (4 Replies)
Discussion started by: super210
4 Replies
5. Shell Programming and Scripting
Hi,
my desired output needs only that has *.pdf
ls -l *.pdf
error: arg list too long
so I have redirected ls -l > file.txt
therefore, I get the following details in the file
-rw-r--r-- 1 devusr devgrp 848015 Aug 11 15:13 0000795769.pdf
-rw-r--r-- 1 devusr devgrp ... (3 Replies)
Discussion started by: techmoris
3 Replies
6. Shell Programming and Scripting
Hi, All -
script1.awk contains the following script:
BEGIN {
printf "The following are directory files:"
"ls -l | grep '^d' | {print $0}"
printf "There were "NR" directories in this list."
}
When I run the script, Here is what I get:
$ awk -f... (4 Replies)
Discussion started by: ora_umair
4 Replies
7. Shell Programming and Scripting
i have this basic piece of code that i am trying to debug to accept input parameter to be able to display a directory listing of files.
cd /u02/app/eatv/dev/out
CURDIR=`pwd`
echo directory listing of $CURDIR
echo
if ; then
ls -latr
else
ls -latr $1
fi
basically if the script... (9 Replies)
Discussion started by: wtolentino
9 Replies
8. Shell Programming and Scripting
In my script I need to list the directory, where the generic name of the files will change, in my test case its set to TEST_*.mqsc. I wrote a small test script as below, but it just does not pip the listing to a file.
Any idea why?
dir='C:/cygwin/var/log/img/aut/'
file=TEST01_*.mqsc
ls $dir... (4 Replies)
Discussion started by: gugs
4 Replies
9. UNIX for Dummies Questions & Answers
hi
I want to list only file name from a directory through shell scripting.
can any body help me. (3 Replies)
Discussion started by: prasann
3 Replies
10. UNIX for Dummies Questions & Answers
Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories.
The following command also shows the files but I only want to see the directories.
ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies