Sponsored Content
Top Forums Shell Programming and Scripting Grabbing the newest file, cleaner method? Post 302581611 by bartus11 on Tuesday 13th of December 2011 01:18:36 PM
Old 12-13-2011
Can those files be located in subdirectories under /opt/work/reports/input? Or are they stored directly in that directory?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grabbing a value from an output file

I am executing a stored proc and sending the results in a log file. I then want to grab one result from the output parameters (bolded below, 2) so that I can store it in a variable which will then be called in another script. There are more details that get printed in the beginning of the log file,... (3 Replies)
Discussion started by: hern14
3 Replies

2. Homework & Coursework Questions

Newest file changed

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The program should search all files in current directory and it's subdirectories and list out the newest file by... (8 Replies)
Discussion started by: petel1
8 Replies

3. Shell Programming and Scripting

Get the newest file in a directory.

I am new to shell scripting so i need some help need how to go about with this problem. I have a directory which contains files in the following format. The files are in a diretory called /incoming/external/data AA_20100806.dat AA_20100807.dat AA_20100808.dat ... (4 Replies)
Discussion started by: ziggy25
4 Replies

4. Shell Programming and Scripting

Kornshell grabbing value from file

I have a script right now that I run a command which outputs just one word to a file. Well I need to grab that value and use it in another line of code so... touch oraclesid.txt echo $ORACLE_SID > oraclesid.txt #grab that value sqlplus v500/v500@<value> how do I grab that value from the... (6 Replies)
Discussion started by: Blogger11
6 Replies

5. Shell Programming and Scripting

Mail file size of newest file in directory

I have been a long time lurker, and have learned a lot from these forums, thank you to everyone. I am using Zoneminder to record a security camera feed. No motion detection, just 24 hour recording. I then have a script that checks Mysql for events dated the day before, and throws them at... (4 Replies)
Discussion started by: iamVERYhungry
4 Replies

6. Shell Programming and Scripting

Cleaner method for this if-then statement?

I have a script that runs once per month. It performs a certain task ONLY if the month is January, April, July, or October. MONTH=`date +%m` if || || || ; then do something else do a different thing fi Is there a neater way of doing it than my four separate "or" comparisons? That... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Find the newest file in two directories

Hi i have two directories and files inside them Directory 1: Directory 2: These files are the same but song.mp3 in Directory 1 is newer than song.mp3 in Directory 2, and work.txt in Directory 2 is newer than work.txt in Directory 1. Now is my question. How i can compare these files... (10 Replies)
Discussion started by: Falstaff
10 Replies

8. Shell Programming and Scripting

Find file by filename or with newest modified date

Hi, I have a directory that has numerous files in it, and there is two which are named "filerec_ddmmyyHH24MMSS" by the time they are created so "filerec_010615012250" was created at 01:22:50 on 1st June 2015. I need to find the most recently created of those 2 files and get the contents of... (4 Replies)
Discussion started by: finn
4 Replies

9. Shell Programming and Scripting

Maybe a cleaner way to generate a file?

greetings, to be clear, i have a solution but i'm wondering if anyone has a cleaner way to accomplish the following: the variable: LSB_MCPU_HOSTS='t70c7n120 16 t70c7n121 16 t70c7n122 16 t70c7n123 16 t70c7n124 16 t70c7n125 16 t70c7n126 16 t70c7n127 16 t70c7n128 16 t70c7n129 16 t70c7n130 16... (2 Replies)
Discussion started by: crimso
2 Replies

10. Shell Programming and Scripting

Delete all but newest of given file name type

I use this to make it easier to see when a backup script ran. touch /media/andy/MAXTOR_SDB1/Ubuntu_Mate_18.04/$( date '+%m-%d-%Y_%I:%M-%p' ) I would like a script that would delete all but the newest file ONLY of this type 08-20-2018_01:24-PM (4 Replies)
Discussion started by: drew77
4 Replies
packingrules(4) 					     Kernel Interfaces Manual						   packingrules(4)

NAME
packingrules - packing rules file for cachefs DESCRIPTION
is a packing rules file for packingrules contains a list of directories and files that are to be packed. It also contains a list of direc- tories and files that are to be specifically excluded from packing. See cachefspack(1M). Many users choose to manually create the packing rules file and edit it by hand. Users can edit the packingrules (using any editor) to permanently change the packingrules file, or to gain access to more powerful options that are not available from the command line (such as the command). It is much easier to enter complex wildcard expressions by editing the packingrules file. Following is a description of the lines in a packing rules file. Blank lines and lines that begin with a pound sign are ignored. Lines can be continued by placing a backslash () immediately before the newline character. All other lines in the packingrules file have one of the following formats: This line identifies a directory (or pair of directories) under which files should be packed. At least one directory name must be specified. The arguments must be fully qualified path names and may include environment variables. This line enumerates a list of files and subdirectories beneath the current directory to be packed. This specification is recursive. That is, specifying the name of a directory automatically includes all files and subdirectories it contains. This line enumerates a list of files that are not to be packed. Regular expressions are permitted. There are important differences between the arguments to the and the statements. The arguments to statements can contain slashes and are interpreted as file names relative to the directories. The arguments to statements are simpler names or expressions that cannot contain slashes. An statement will not override a LIST statement. statements only exclude files that are found beneath listed directories. If the first name argument to a or an statement begins with an exclamation point the remainder of the statement will be executed as a com- mand that will be run in the current directory. The output of the command will be treated as a list of newline separated file names to be packed command) or to be excluded from the packing list command). For the command, the resulting file names will be interpreted relative to the enclosing directory. Blanks can be embedded in an argument by escaping them with a backslash () or enclosing the argument in double quotes (` " '). Double quotes can be passed in arguments by escaping the double quotes with a backslash (). lines only apply to the statement that precedes them. lines can appear before any statement (in which case they apply to all or after a statement (in which case they only apply to the that precedes them). Any number of these statements can occur in any combinations. The order is not important. EXAMPLES
The use of these statements is illustrated in the following packing rules file. # # Ignore junk files. # IGNORE core *.o *.bak *% # # Pack everything in the work subdirectory and in a few # favorite mailboxes. # BASE /net/bigserver/export/home/myname LIST work LIST m/incoming LIST m/action LIST m/pending # # Pack two important project directories but skip # all postscript output. # BASE /net/bigserver/export/projects $HOME/projects LIST poindexter epiphany IGNORE *.ps # # Pack the foonly package. # BASE /net/bigserver/opt/foonly /opt/foonly LIST !cat .packinglist # # Also pack the latest executables for the standard # build environment. # BASE /net/bigserver/export/buildenv $HOME/buildenv LIST !find . -type f -a -perm -111 -a -print AUTHOR
was developed by Sun Microsystems, Inc. SEE ALSO
cachefspack(1M). packingrules(4)
All times are GMT -4. The time now is 12:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy