Sponsored Content
Top Forums Shell Programming and Scripting How to check in a folder all files which doesnt have the specifc string? Post 303024611 by wbport on Friday 12th of October 2018 02:30:26 PM
Old 10-12-2018
If this is to be part of a script that will do different things depending on whether or not a pipe is found, you might want to add a -q to the command line when you no longer need to see its active. Your if statement can check the status code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace string in all files in a folder and subfolders.

i need to change string in all files in current folder and all subfolders. i wrote the following script. It works good except it dont delete temp file from subfolders. for z in `find . -type f -name "*.html" -o -name "*.htm"`; do sed -e 's@abc@xyz@g' $z>temp; mv temp $z; done any idea?... (1 Reply)
Discussion started by: crazynups
1 Replies

2. SuSE

Regarding Readable check for all the files in the folder

Currently we are doing the migration to unix to linux. I am facing the new problem kganeshb@its04489:~/scripts $ ls -l | more total 340 -rw-r----- 1 kganeshb users 9038 Oct 22 13:23 109_db.txt -rw-rw---- 1 dlc users 1413 Oct 10 17:40 1.txt -rw-rw---- 1 kganeshb users 45 Jan 28 13:46 a... (2 Replies)
Discussion started by: kingganesh04
2 Replies

3. Shell Programming and Scripting

HOW TO CHECK ONLY .C FILES EXISTS OR NOT IN A FOLDER using IF in C shell script?

Hi friends.. I hav a problem.... I dont know how to check .c files exists r not in a folder using IF in C shell script actually i tried like this if(=~ *.c) even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Discussion started by: p.hemadrireddy
17 Replies

4. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

5. Shell Programming and Scripting

Check file and if it doesnt exist , exit script

Hi, Another problem, here is my code #!/bin/sh dir='/opt/apps/script/CSV' datadir='/opt/apps/script/data' while : ; do ls -1rt $dir/*.csv > /dev/null 2>&1 if ;then cp $datadir/weekly.txt $dir/weekly.csv else exit 0 fi done (10 Replies)
Discussion started by: tententen
10 Replies

6. Shell Programming and Scripting

Checking files in folder using starting string for filename

Hi, How do i check if there are any files present in the folder with some specific starting string. For eg :- I have used this where Source_File is filename parameter. if then return 2 fi But in my case the source file name is not constant. The only constant thing is... (10 Replies)
Discussion started by: chetancrsp18
10 Replies

7. Shell Programming and Scripting

check existence of files in a folder

Hi I am having a problem to verify existence of files. I need to know whether or not files in a folder that begins with a name. For example all files that start with The_File_ *. I was doing it this way, but gives me error. if text -f /work/The_File_* then ... else .. fi (5 Replies)
Discussion started by: Rodrih92
5 Replies

8. UNIX for Dummies Questions & Answers

Replacing a particular string in all files in folder and file contents

I need to replace all filesnames in a folder as well as its content from AK6 to AK11. Eg Folder has files AK6-Create.xml, AK6-system.py etc.. the files names as well as contents should be changes to AK9-Create.xml, AK9-system.py etc All files are xml and python scripts. ---------- Post... (0 Replies)
Discussion started by: Candid247
0 Replies

9. Shell Programming and Scripting

Bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

10. UNIX for Beginners Questions & Answers

Merging specifc lines of three files into one?

Recall that nc-county-pop.dat has 100 lines, and each line corresponds to a county. The files girls.dat and boys.dat each has 50 lines. Assume that the girls come from the first 50 counties and each county has only one girl. That is the first girl comes from the first county, the second girl comes... (1 Reply)
Discussion started by: novicep11
1 Replies
SCANSPOOL(8)						    InterNetNews Documentation						      SCANSPOOL(8)

NAME
scanspool - Perform a sanity scan over all articles in news spool SYNOPSIS
scanspool [-cnv] [-a active-file] [-s spool-dir] DESCRIPTION
scanspool is a Perl script for use with a tradspool article spool. It will scan the active file as well as all articles in the spool and report on the errors it encounters. As this may take a while, using the -v switch is recommended to see how far the program has progressed. First, scanspool scans the active file, noting problems such as: o malformed lines; o newsgroups aliased to a non-existent newsgroup; o newsgroups aliased to a newsgroup that is also aliased. Then it will examine all articles under your news spool directory, complaining about articles that: o have a basename that starts with a leading 0; o have a basename that is out of range according to the active file; o do not contain a Newsgroups: header line; o are all header and no text; o are in a directory for which there is no newsgroup in the active file; o are in a newsgroup to which they do not belong. scanspool understands aliased newsgroups. Thus, if an article is posted to foo.old.name that is aliased to foo.bar, it will be expected to be found under foo.bar and not foo.old.name. Articles posted to a newsgroup of status "j" or "x" (the fourth field of the active file) will be expected to show up under the junk group. scanspool assumes that the path of a valid newsgroup's directory from the root of the spool tree will not contain any "." character. Thus, directories such as out.going, tmp.dir, in.coming and news.archive will not be searched. This program also assumes that article basenames contain only decimal digits. Last, files under the top level directory lost+found are not scanned. OPTIONS
-a active-file The active file to use; pathdb/active is the default. -c Only check article filenames. scanspool will therefore not actually scan the Newsgroups: header field of the articles. -n Don't throttle innd while scanning. -s spool-dir The root of the spool tree; patharticles is the default. -v Setting this flag enables a verbose mode. scanspool will then print which newsgroup is currently worked upon. It will list all the articles found in non-active directories (that is to say articles sorted into groups no longer present in the active file), rather than just printing the group once. DIAGNOSTICS
The output of scanspool will start with one of the following forms: "FATAL:" (to stderr) Fatal or internal error. "WARN:" (to stderr) active or article format problem, newsgroup alias problem, find(1) error, article open error. "path/123:" (to stdout) Issues such as: o basename starts with 0; o article number out of range; o article in the wrong directory; o article in a directory not related to an active non-aliased newsgroup. " ..." (to stdout) Verbose messages start with a tab. BUGS
scanspool is unable to detect and properly deal with spool formats other than tradspool. However, if the files that store your articles are named other than just all-digits, they will simply be skipped (and your active is still checked). scanspool only considers the first line of the Newsgroups: header field. Continuation lines are not taken into account. HISTORY
scanspool was written by Landon Curt Noll (chongo was here /../). This manual page was written by Florian Schlichting, largely based on comments in the script. $Id: scanspool.pod 9302 2011-08-04 21:10:17Z iulius $ SEE ALSO
active(5). INN 2.5.3 2011-08-22 SCANSPOOL(8)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy