Sponsored Content
Top Forums UNIX for Dummies Questions & Answers latest files copying over to new path Post 302536481 by Corona688 on Tuesday 5th of July 2011 01:37:39 PM
Old 07-05-2011
Code:
ls -lrt | nawk -v D="$(date +'%b%e:'| sed 's/ //g')" 'D==$6$7":"{sub(".*"$9,$9);print}' | while read FILENAME
        do cp "$FILENAME" /path/to/dest/
done

---------- Post updated at 11:37 AM ---------- Previous update was at 11:34 AM ----------

If you could explain what you were accomplishing with nawk, there may be a better way to do this with find.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying files with the latest date

Hi All, I have a situation where I need to copy the files having the latest date. For example I have a file by name bas100e1_jun05. I need to copy it to bas100e1. But when a file by name bas100e1_jul05 is put in the same directory the script should copy the file having the latest month which... (34 Replies)
Discussion started by: shashi_kiran_v
34 Replies

2. Shell Programming and Scripting

copying the latest file

Hi, I have a problem. I have some text files in a folder. The names can be like: emp_20080307053015.dat emp_20080306053015.dat emp_20080305053015.dat emp_20080304053015.dat The date format appended is like yyyymmdd and timestamp. What i need is i have to copy the latest file every... (12 Replies)
Discussion started by: Aswarth
12 Replies

3. Shell Programming and Scripting

copying unreference files and keeping absolute path

Hi guys, I'm creating a script that basically remove unreference files so at the moment I have something like: DAYS=30 for DIRECTORY in `mount | awk '{ print $7}'` do find $DIRECTORY -type f -atime +$DAYS < ~/files.log done for FILE in `awk '{print $1}' ~/files.log` do cp... (2 Replies)
Discussion started by: hariza
2 Replies

4. Shell Programming and Scripting

Copying latest file into a folder

Hello all, this is my first post while i am trying to understand unix. I would basically like to know if i can do this: Lets say i have a folderA and folderB And i save something in folderA Can i make a script that checks folderA latest file, then compares it with the date of latest file in... (16 Replies)
Discussion started by: takissd
16 Replies

5. Shell Programming and Scripting

Copying a directory structure with the latest versions of files

Hello I have three directory structures for code releases. Each directory structure looks like this: bash-3.00$ ls -R | more .: Test_Release_1 Test_Release_2 Test_Release_3 ./Test_Release_1/dbcode: rp_online_import_srdp.pkb-1 srdp_ar_validation.pkb-1... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies

6. Shell Programming and Scripting

copying a list of files from one machine to another with the same path

Hello All, I would like to download a list of files from a remote server to my local machine preserving the path i.e, create a similar directory tree. ex: files on the remote machine with path /remoteserver/005_S_0221/mpr/m1/I72128/dat/06A515T.dat... (3 Replies)
Discussion started by: avatar_007
3 Replies

7. Shell Programming and Scripting

Timestamp copying giving file path and name as inputs

PLAESE CHECK WHETHER THIS SCRIPT WORKS OR NOT. THIS IS MY FIRST SCRIPT, HELP ME out if any ERRORS are present. a=0; while do echo "ENTER path" read path if then echo "path found" cd $path DateTimeStamp=$(date '+%d_%m_%y_%H_%M') echo "enter file name" read file (2 Replies)
Discussion started by: arunreddy01
2 Replies

8. Shell Programming and Scripting

Perl : copying only the latest file to other directory

In linux.. In a directory there are 3 files which I want to copy only the latest file (ls -ltr myfiles*.txt|tail -1) to other directory in perl? Could anyone please help me with the code? Regards, J (1 Reply)
Discussion started by: scriptscript
1 Replies

9. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

10. Shell Programming and Scripting

Search Files on a given path based on latest time stamp

find /app/data -name "Availability" - Below is the output now i need to filter based on latest modified timestamp. I know 3 is the latest modified time stamp but i tried different options but only filtering docs and not on headnote..Can any one tell me how to do that.. ... (2 Replies)
Discussion started by: vkiyv05
2 Replies
BRANDY(1)						      BBC BASIC V interpreter							 BRANDY(1)

NAME
brandy - a portable BBC BASIC V interpreter SYNOPSIS
brandy [-help] [-size SIZE] [-lib FILENAME] [-load FILENAME] [-path DIRECTORY[,DIRECTORY]...] [-quit FILENAME] [-chain FILENAME] [-ignore] [FILENAME] DESCRIPTION
Brandy is an interpreter for BBC BASIC V, the dialect of BASIC that Acorn Computers supplied with their ranges of desktop computers that use the ARM processor such as the Archimedes and Risc PC, and is still in use on these and compatibles. BASIC V is a much extended version of BBC BASIC. This was the BASIC used on the 6502-based BBC Micro that Acorn made during the 1980s. OPTIONS
-help Print a summary of these options. -size SIZE Set the size of the Basic workspace to SIZE bytes when starting the interpreter. The minimum size allowed is 10000 bytes and any- thing below this value will be set to it. The maximum size is limited only by the environment in which the program is being run. The size may have a suffix of k to denote that the size is in kilobytes or m if it is in megabytes. For example, -size 100k will set the workspace size to 100 kilobytes (102400 bytes) and -size 8m will set it to eight megabytes (8388608 bytes). -lib FILENAME Load Basic library FILENAME when the interpreter starts. This option can be repeated as many times as required to load a number of libraries. This is equivalent to typing INSTALL "FILENAME" at the interpreter's command line. The libraries are loaded in the order given on the command line. Note that the search order is the reverse of this. -load FILENAME Load Basic program FILENAME when the interpreter starts. -path DIRECTORY[,DIRECTORY]... This specifies a list of directories that the interpreter will search when looking for libraries and programs. The directory names are separated by commas. The pseudo-variable FILEPATH$ is set to this value. -quit FILENAME Load and run the Basic program FILENAME. Leave the interpreter when the program has finished running. -chain FILENAME Load and run the Basic program FILENAME. Remain in the interpreter when the program has finished running. -graphics Start the interpreter with the screen in graphics mode in versions of the program which support graphics and the screen can be in either text or graphics modes. -ignore Ignore certain `unsupported feature' errors. By default the interpreter reports an error whenever it comes across a BASIC V feature that it does not support. This option allows some unsupported features that do not affect the basic running of the program to be ignored. FILENAME This is exactly equivalent to -chain. The case of the names of the options is ignored. It depends on the operating system under which the interpreter is running as to whether the names of files are case sensitive or insensitive. FILES
brandy executable /usr/share/doc/brandy/examples example BASIC programs SEE ALSO
/usr/share/doc/brandy full documentation Brandy's home page http://jaguar.orpheusweb.co.uk/branpage.html There is some very useful documentation for the BBC Micro available on the Internet. One very good site is The BBC Lives! at: http://www.nvg.ntnu.no/bbc/ or see http://sourceforge.net/projects/brandy/ AUTHOR
David Daniels, with contributions from Darren Salt and Colin Tuckley REPORTING BUGS
Report bugs to the bug tracker at http://sourceforge.net/projects/brandy COPYRIGHT
Copyright (c) 2000, 2001 David Daniels. Copyright (c) 2009, 2012 Colin Tuckley. This is free software; see the source for copying condi- tions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. brandy 1.20pre5 10 Jun 2012 BRANDY(1)
All times are GMT -4. The time now is 04:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy