02-25-2005
copy and rename list of files
Hi all,
I am a newbie in writng unix..I am using ksh shell..Does anyone know how to copy a list o files from directory A to directory B with differnt names? i.e
in Dir A, I have
RPT101.555.TXT
RPT102.666.TXT
and I want to copy those files to dir B with new naming convention..
in Dir B, I wanna have those files names
RPT.101.555.20050225163012.TXT
RPT.102.666.20050225163013.TXT
...
where 20050225163012 is infact the timestamp when I copy those files
format is yyyymmddHHmmss
I try to use comand sed ..but I am in big mess right now..
please help.. Thx~!
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have few webservers logs like access.log. which would be growing everyday.
what i do everyday is, take the backup of access.log as access.log_(currentdate) and nullify the access.log.
So thought of writing a script... but stuck up in middle.
My requirement: to take the backup and nullify... (6 Replies)
Discussion started by: logic0
6 Replies
2. Shell Programming and Scripting
hello, I need to build a shell script that receives the folder to copy by parameter and copy all files except thumb.db to another folder and rename them like, file.jpg renamed to file_bb1.jpg.
can someone help me
Thanks (4 Replies)
Discussion started by: zeker
4 Replies
3. Shell Programming and Scripting
hello,
I am write a Script and i would listing all Files from Path1 out with DSR*.txt and give a new name an copy to the Path2.
I have problems with that to rename. Someone can help me?
Sorry, for my english. My english is not gut.
I hope you understand my.
That is my Script.
... (2 Replies)
Discussion started by: efeijoo
2 Replies
4. Shell Programming and Scripting
Hi All,
I am new to scripting and am looking for some assistance setting up a script. Basically I need the script to scan a folder for the newest files and make a copy of those files, adding a month to the date stamp. I also need this script to delete the previously copied files to save space.... (4 Replies)
Discussion started by: Lucid13
4 Replies
5. Shell Programming and Scripting
How can i rename list of files in a directory? (4 Replies)
Discussion started by: knip
4 Replies
6. Shell Programming and Scripting
I need to pull down a good bit of files for another support team for an upgrade project. I have a server.list with all of the server names.
I need to do two parts:
FIRST:
I have this example, but it does not list the server name in front of each line.
#! /bin/bash
for server in $(<... (10 Replies)
Discussion started by: asnatlas
10 Replies
7. Shell Programming and Scripting
Is better way to write the script loop through one by one "Old_File_1: & New_File_1:" to copy 100 files to /staging/test folder then re-name & gzip all those files? I wrote this code below and don't like that much. Thanks
I have a control_file under /tmp/test folder like below 100 files and... (10 Replies)
Discussion started by: dotran
10 Replies
8. Shell Programming and Scripting
Hi,
I require help to complete below requirement through Linux Script.
I have a SQL query which shows two columns as output. One is Report Name and other is report path. Query return multiple rows. below is the output.
Report Name
Cotton Stock Report (Net Weight)- Customized
Output... (3 Replies)
Discussion started by: usman_oracle
3 Replies
9. Shell Programming and Scripting
#!/bin/sh
sqlplus -s "/ as sysdba" << EOF
SET HEADING OFF
SET FEEDBACK OFF
Select
pt.user_concurrent_program_name , OUTFILE_NAME
FROm
apps.fnd_concurrent_programs_tl pt,
apps.fnd_concurrent_requests f
where
pt.concurrent_program_id = f.concurrent_program_id
and pt.application_id =... (1 Reply)
Discussion started by: usman_oracle
1 Replies
LEARN ABOUT DEBIAN
test::dir
Test::Dir(3pm) User Contributed Perl Documentation Test::Dir(3pm)
NAME
Test::Dir - test directory attributes
SYNOPSIS
use Test::More ...;
use Test::Dir;
DESCRIPTION
This modules provides a collection of test utilities for directory attributes. Use it in combination with Test::More in your test
programs.
FUNCTIONS
dir_exists_ok(DIRNAME [, TESTNAME] )
Ok if the directory exists, and not ok otherwise.
dir_not_exists_ok(DIRNAME [, TESTNAME] )
Ok if the directory does not exist, and not ok otherwise.
dir_empty_ok(DIRNAME [, TESTNAME] )
Ok if the directory is empty (contains no files or subdirectories), and not ok otherwise.
dir_not_empty_ok(DIRNAME [, TESTNAME] )
Ok if the directory is not empty, and not ok otherwise.
dir_readable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is readable, and not ok otherwise.
dir_not_readable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is not readable, and not ok otherwise.
dir_writable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is writable, and not ok otherwise.
dir_not_writable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is not writable, and not ok otherwise.
dir_executable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is executable, and not ok otherwise.
dir_not_executable_ok(DIRNAME [, TESTNAME] )
Ok if the directory is not executable, and not ok otherwise.
TO DO
I know there are a lot more directory attributes that can be tested. If you need them, please ask (or better yet, contribute code!).
AUTHOR
Martin 'Kingpin' Thurn, "mthurn at cpan.org", <http://tinyurl.com/nn67z>.
BUGS
Please report any bugs or feature requests to "bug-test-dir at rt.cpan.org", or through the web interface at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Dir>. I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Test::Dir
You can also look for information at:
o RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Dir>
o AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Test-Dir>
o CPAN Ratings
<http://cpanratings.perl.org/d/Test-Dir>
o Search CPAN
<http://search.cpan.org/dist/Test-Dir>
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright (C) 2007-2008 Martin 'Kingpin' Thurn
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2011-03-05 Test::Dir(3pm)