10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
The below bash works great, except I can not seem to delete the original file $f from the directory. Thank you :)
For example, after the bash executes there are 8 files in the directory:
123.txt (original file)
123_remove.txt
123_index.txt
123_final.txt
456.txt (original file)... (11 Replies)
Discussion started by: cmccabe
11 Replies
2. UNIX for Dummies Questions & Answers
Hi Folks,
There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Discussion started by: punpun66
1 Replies
3. Shell Programming and Scripting
I would like to remove comments from a bash script. In addition, I would like to remove lines that consist of only white spaces, and to remove blank lines.
#!/bin/bash
perl -pe 's/ *#.*$//g' $1 | grep -v ^]*$ | perl -pe 's/ +/ /g' > $2
#
# $1 INFILE
# $2 OUTFILE
The above code... (10 Replies)
Discussion started by: LessNux
10 Replies
4. Shell Programming and Scripting
Hello All
I want to delete the directory in my tree structure . all the filenames like this
dd-mm-yyyy
Example
30-01-2011
31-01-2011
01-02-2011
I want to grep the latest last four days created directorey by not using the find command . how do i do that ? (1 Reply)
Discussion started by: kvk_shell
1 Replies
5. Shell Programming and Scripting
hello!
i need to make a script that get a folder name in parameter and i get back the size of the folder include the subfolders! but i dont know how i need to start :S
Example:
a folder contain the followings
a:
drwxr-xr-x 2 user user 4096 febr 25 08.27 b
-rw-r--r-- 1 user user 2 febr... (3 Replies)
Discussion started by: impish
3 Replies
6. Shell Programming and Scripting
Hello forum members,
I am writing a script to two tasks.
1: displaying the list of the files in the current directory.
2: removing the specifed file from the list.
I have written a sample script ,so can u please verfiy and correct.
echo Enter list of files
ls *.txt
read textfile
rm -f... (3 Replies)
Discussion started by: sivaranga001
3 Replies
7. Shell Programming and Scripting
Hi Guys,
I am creating a couple of temp. files in a script. After completing the script, I am using the rm command to delete these files. The files are getting deleted but I am getting "filename - cannot find file;no such file or directory" error in my bash shell terminal window.
I am using... (3 Replies)
Discussion started by: npatwardhan
3 Replies
8. Shell Programming and Scripting
Hi,
I have shell script which is located in /opt/Test/test.sh
code in test.sh is as follows
#!/bin/sh
rm -rf /opt/Test
exit 0
when I tried to execute the above script from its location, it shows the following error
rm: Cannot remove any directory in the path of the... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies
9. Shell Programming and Scripting
Hi guys,
I am working with a script within a Mac OS X package installer. The package installer will run the bash script once the files have been copied/installed. I have a little trouble with the last line of my script causing the package installer to crash once in a while and I have narrowed it... (1 Reply)
Discussion started by: tret
1 Replies
10. Shell Programming and Scripting
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
Discussion started by: cat123
5 Replies