Sponsored Content
Top Forums Shell Programming and Scripting Script to move files based on Pattern don't work Post 302249707 by Annihilannic on Wednesday 22nd of October 2008 12:15:03 AM
Old 10-22-2008
I think you need to have no space between -I and the pattern to ignore, e.g.:

Code:
basico=`ls -I"$teste3" | grep -v Historico`

You can make sure it is a file before copying it by doing something like this:

Code:
[[ -f $WORKDIR/$teste2/$j ]] && cp $WORKDIR/$teste2/$j $WORKDIR/ERROR_FILES >> $LOGS/Check_files_1_$stamp.log

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find options don't work in script

Hi, I'm trying to write a bash script to find some files. However it seems that the find command is not behaving the same way when the script is executed as it does when executed from the command line: Script extract: #!/bin/bash ... NEW="/usr/bin/find current/applications/ -name '*jar'... (3 Replies)
Discussion started by: mattd
3 Replies

2. Shell Programming and Scripting

Unix Script To Move Files Based On Grep

I am looking for advice on how to write a script that will rename and/or move files to a different directory based upon the results of a grep. Let's say I have ten files in a directory. Some of them - not all - contain the text 'HELLO'. I would like to be able to grep the files for that text,... (3 Replies)
Discussion started by: rjhjr64
3 Replies

3. Solaris

I don`t understand how It work (about startup script)?

Hi all. The startup script in /usr/local/bin. After user login the script run an application. Iwould in the same way run the another application. How to make It similar? Where I must to look? Regards. (3 Replies)
Discussion started by: wolfgang
3 Replies

4. Shell Programming and Scripting

Need script to move files based on name

Hi folks, I'm new here and appreciate greatly any help. I have a bunch of files that need be moved and renamed. Fortunately, they are all in sequence... Present filename and path: /.catalog1/t76038_842-01 Move to: /.catalog1/76038-01 So, we need to drop the... (8 Replies)
Discussion started by: axslinger
8 Replies

5. UNIX for Dummies Questions & Answers

HELP Script don't work selecting lowest value!!!

Hy again guys, Last week i resolve a question here but now i need your help again :rolleyes: I have about 3000 files that i need to choose based on the lowest value, so i make temp files like this: The files can have lines from 1-10 but only 2 columns, the point is to grep the name os the... (2 Replies)
Discussion started by: MetaBolic0
2 Replies

6. UNIX for Dummies Questions & Answers

Need script to move files based on month

Hi , I need a script which moves files based on month. Example : Apr 29 03:16 log4.txt Apr 29 03:16 log5.txt May 4 09:17 log1.txt May 4 09:17 log2.txt Move Apr files into Apr2015(Folder) Move May files into May2015(Folder). This is urgent requirement , if you can help me... (5 Replies)
Discussion started by: rockingvj
5 Replies

7. Shell Programming and Scripting

Move directories in script.sh doesn't work

Dear All, I would like move some directories in another location. Basically, my ls -lis drwxr-xr-x 3 XXXXXXXXXXXXXXXXXXXX 4096 Feb 24 02:18 data.N701_N502.ABCDE -rw-r--r-- 1 XXXXXXXXXXXXXXXXXXXX 185865797 Feb 23 11:27 data.N701_N502.ABCDE_file1 -rw-r--r-- 1 XXXXXXXXXXXXXXXXXXXX... (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

8. Shell Programming and Scripting

A shell script to run a script which don't get terminated and send a pattern from the output by mail

Hi Guys, I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

9. Shell Programming and Scripting

Move files with a certain suffix based on how many files are in another folder

Hello, First time poster. I am looking for a way to script or program the process of moving files from one folder to another, automatically, based on the count of files in the destination folder. I was thinking a shell script would work, but am open to the suggestions of the experts... (6 Replies)
Discussion started by: comtech
6 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to append multiple text files into one file based on pattern present in filaname

Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames? AAAL_555A_ORANGE1_F190404.TXT AAAL_555A_ORANGE2_F190404.TXT AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Discussion started by: Shankar455
6 Replies
PORTSNAP.CONF(5)					      BSD File Formats Manual						  PORTSNAP.CONF(5)

NAME
portsnap.conf -- configuration file for portsnap(8) DESCRIPTION
The portsnap.conf file controls where portsnap(8) fetches ports tree snapshots from, which RSA key should be trusted to sign the updates, and what directories should hold the compressed and live ports trees. A line of the form SERVERNAME=portsnap.example.com specifies the source from which snapshots should be fetched. This is equivalent to the -s server option to portsnap(8), and will be ignored if the command-line option is used. A line of the form KEYPRINT=0123456789abc ... 456789abcdef (64 characters in total) specifies the SHA-256 hash of the OpenSSL public key file belonging to an RSA keypair which is trusted to sign updates. This is equivalent to the -k KEY option to portsnap(8), and will be ignored if the command-line option is used. A line of the form WORKDIR=/path/to/workdir specifies the directory in which portsnap should maintain its compressed snapshot of the ports tree. This is equivalent to the -d workdir option to portsnap(8), and will be ignored if the command-line option is used. A line of the form PORTSDIR=/path/to/portstree specifies the directory in which portsnap will create the live ports tree from its compressed snapshot via the extract and update commands. This is equivalent to the -p portsdir option to portsnap(8), and will be ignored if the command-line option is used. If more than one line of any of the above forms is included in portsnap.conf then only the last one will take effect. A line of the form INDEX INDEXFILE DESCRIBEFILE will instruct portsnap(8) that the specified INDEX file is generated from the specified describe file distributed by the portsnap server. Finally, a line of the form REFUSE foo bar will instruct portsnap(8) to ignore parts of the ports tree with paths starting with foo or bar, which are interpreted as extended regular expressions by egrep(1). This will result in those parts of the tree not being updated in the compressed snapshot when the fetch and cron commands are used and not being extracted when the extract command is used (unless a specific path is passed to portsnap(8)), and if those parts of the ports tree are present they will not be updated when the update command is used. Unlike the other options, the parameters in REFUSE lines accumulate and all such lines are considered. Note that operating with an incomplete ports tree is not supported and may cause unexpected results. Any lines not of the above forms will be ignored. FILES
/etc/portsnap.conf Default location of the portsnap configuration file. SEE ALSO
egrep(1), fetch(1), portsnap(8), sha256(8) AUTHORS
Colin Percival <cperciva@FreeBSD.org> FreeBSD January 30, 2005 FreeBSD
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy