Sponsored Content
Top Forums Shell Programming and Scripting a remove script taken in input a file which contain a list of directories Post 302234223 by jim mcnamara on Tuesday 9th of September 2008 10:31:13 AM
Old 09-09-2008
Code:
while read srcdir
do
     find $srcdir -type f 
done < supprs.txt

After you run this to verfiy the files are correct change the find line to this:
Code:
while read srcdir
do
     find $srcdir -type f -exec rm -f {} \;
done < supprs.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to list changes in Directories

Hello guys it's me again, I need some help. What I'm doing is listing all the file and directories Recusively and using it a a master file. Then I need to do the same the nest day to make sure nothing was deleted or modified. What happen is file in one of out major directories was deleted without... (2 Replies)
Discussion started by: aojmoj
2 Replies

2. Shell Programming and Scripting

help with script to list directories

Hi All I have two scripts which i used to try and list all the directories one using 'function', which only lists the first directory and does not show directories within directories. function ListDir () { for arg in $(ls $HOME) do if then echo $arg ... (2 Replies)
Discussion started by: chassis
2 Replies

3. Shell Programming and Scripting

read list of filenames from text file and remove these files in multiple directories

I have a large list of filenames from an Excel sheet, which I then translate into a simple text file. I'd like to use this list, which contains various file extensions , to archive these files and then remove them recursively through multiple directories and subdirectories. So far, it looks like... (5 Replies)
Discussion started by: fxvisions
5 Replies

4. Shell Programming and Scripting

Remove duplicate columns in input file

hello, I have an input file which looks like this: 2 C:G 17 -0.14 8.75 33.35 3 G:C 16 -2.28 0.98 28.22 4 C:G 15 0.39 11.06 29.31 5 G:C 14 2.64 5.17 36.07 6 G:C 13 -0.65 2.05 21.94 7 C:G 11 138.96 21.64 14.40 9 C:G 27 -2.40 6.95 27.98 10 C:G 26 2.89 15.60 34.33 11 G:C... (7 Replies)
Discussion started by: linux_usr
7 Replies

5. Shell Programming and Scripting

Separating list of input files (*.file) with a comma in bash script

Hi all, I'm trying to get a bash script working for a program (bowtie) which takes a list of input files (*.fastq) and assembles them to an output file (outfile.sam). All the .fastq files are in one folder in my home directory (~/infiles). The problem is that the 'bowtie' requires that... (7 Replies)
Discussion started by: TuAd
7 Replies

6. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

7. Shell Programming and Scripting

Chose list of sub directories in a bash script file

Hi, I have a command in my bash script, searchDirectoryName.sh: DIR_NAME=$(find . -type d) echo "${DIR_NAME}" . ./Dir1 ./Dir1/1.0.2.1 ./Dir2 ./Dir2/1.1 ./Dir3 ./Dir3/2.2.1 How can I select only following directory names with second subdirectoies and without first ./ in the... (3 Replies)
Discussion started by: hce
3 Replies

8. Shell Programming and Scripting

Remove directories when specific file is in directory?

Hello :) I need little help i have following cmd: this only able to delete files but not folder which contain that file find /home/test/* -name "*.testfile" -type f -exec rm -i {} \; how to delete whole directory if file called somethingblahblah.testfile is there? Thanks you :) (3 Replies)
Discussion started by: ZerO13
3 Replies

9. UNIX for Beginners Questions & Answers

Need list of input and output parameter of task in a text file, using shell script

//file begin ===== //some code task abcd_; input x; input y,z; //some comment output w; //some comment reg p; integer q; begin //some code end endtask : abcd_ //some code //file end ===== expected output from above... (1 Reply)
Discussion started by: rishifrnds
1 Replies

10. UNIX for Beginners Questions & Answers

Remove Comment Lines From Script/Input File

Hello, I have a SAS code that predominantly has comments line and the real code like below and i want to remove ONLY THE COMMENTS from the code in the single line or spanned across multiple lines. /******************************************************************** *** This Is a Comment... (4 Replies)
Discussion started by: arooonatr
4 Replies
POSTINSTALL(8)						    BSD System Manager's Manual 					    POSTINSTALL(8)

NAME
postinstall -- check and fix installation after system upgrades SYNOPSIS
postinstall [-a arch] [-d destdir] [-m machine] [-s {srcdir | tgzdir | tgzfile}] operation [item [...]] DESCRIPTION
The postinstall utility performs post-installation checks and/or fixes on a system's configuration files. It is especially useful after sys- tem upgrades, e.g. after updating from NetBSD 1.6.2 to NetBSD 2.0. The items to check or fix are divided in two groups: enabled by default and disabled by default. The latter are items that are dangerous for some reason, for example because they remove files which may be still in use. If no items are provided, the default checks or fixes are applied. Those which are disabled by default must be provided explicitly. Supported options: -a arch MACHINE_ARCH. Defaults to machine of the host operating system. -d destdir Destination directory to check. Defaults to /. -m machine MACHINE. Defaults to machine of the host operating system. -s {srcdir | tgzdir | tgzfile} The location of the reference files, or the NetBSD source files used to create the reference files. This may be speci- fied in one of three ways: -s srcdir The top level directory of the NetBSD source tree. By default this is /usr/src. -s tgzdir A directory in which reference files have been extracted from a binary distribution of NetBSD. The files that are distributed in the ``etc.tgz'' set file must be present. The files that are distributed in the ``xetc.tgz'' set file are optional. -s tgzfile The location of a set file (or ``tgz file'') such as ``etc.tgz'' or ``xetc.tgz'' from a binary distribu- tion of NetBSD. Each set file is a compressed archive containing reference files, which will be extracted to the temproot directory. Multiple -s options may be used to specify multiple set files. The ``etc.tgz'' set file must be specified. The ``xetc.tgz'' set file is optional. The operation argument may be one of: check Perform post-installation checks on items. diff [diff(1) options] Similar to check, but also show the differences between the files. fix Apply fixes that check determines need to be applied. Not all items can be automatically fixed by postinstall, and in some cases an error will be reported, after which manual intervention will be required. Conflicts between existing files in the target file system and new files from the NetBSD distribution are resolved by replac- ing the existing file with the new file; there is no attempt to merge the files. See etcupdate(8) for an alternative update method that is able to merge files. help Display a short help. list List available items, showing if they are enabled or disabled by default. usage Same as help. EXIT STATUS
The postinstall utility exits 0 on success, and >0 if an error occurs or a problem was found. SEE ALSO
etcupdate(8) HISTORY
The postinstall utility first appeared in NetBSD 1.6. In NetBSD 4.0, the -s tgzfile option was added. In NetBSD 5.0, the ability to specify multiple colon-separated files with a single -s option was deprecated. BSD
October 4, 2008 BSD
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy