Sponsored Content
Full Discussion: Move multiple files
Top Forums Shell Programming and Scripting Move multiple files Post 302485917 by jmahal on Thursday 6th of January 2011 01:04:40 PM
Old 01-06-2011
Move multiple files

Hi all ..

I am trying :-
Code:
#! /bin/sh
# Archives target file ftp'd to SAP ECC
srcfiles=/usr/dw/apps/work/PROJECT_NEW/SrcFiles/$1/*.txt
tgtfiles=`ls /usr/dw/apps/work/PROJECT_NEW/TgtFiles/FTP/$1/*.txt`

for i in $tgtfiles
do

mv $i  /usr/dw/apps/work/PROJECT_HUDSON/archive/Tgt/$1/$i_`date +%Y%m%d_%H%M%S`.bkp
done

if [ -e $srcfiles ]; then
exit 15
else exit 0
fi

I get the following when I echo the mv command ..
/usr/dw/apps/work/PROJECT_NEW/archive/Tgt/IE0272/20110106_185552.bkp

It does not pick up the filename to append to the timestamp ..

Any ideas?

Last edited by Franklin52; 01-06-2011 at 02:11 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find, Append, Move & Rename Multiple Files

Using a bash script, I need to find all files in a folder "except" the newest file. Then I need to insert the contents of one text file into all the files found. This text needs to be placed at the beginning of each file and needs a blank line between it and the current contents of the file. Then I... (5 Replies)
Discussion started by: Trapper
5 Replies

2. UNIX for Dummies Questions & Answers

Multiple stage file move?

Greetings all. I need is a script that will move a file from one known dir to another, then grab another file from a different dir to replace it, and have absolutely zero clue how to do this. Here's what I am trying to do: A web client wants his site header image to change based on US... (2 Replies)
Discussion started by: ccvortex
2 Replies

3. Shell Programming and Scripting

To move multiple files to a new folder everytime

Hi , Below is the scenario A.txt B.txt C.csv .......... i want to move all the above files in to a new path & new folder .This folder is created based on date(for ex: today's fodler name will be 20120222).for Everyday move a new folder based on date has to be created & this folder... (1 Reply)
Discussion started by: jagadeeshn04
1 Replies

4. Shell Programming and Scripting

Script to move files in multiple folders

Hello all, I would appreciate any help to write a script. I have folder A which contains over 30 thousands xml files, I would like create multiple folders and move those files (500 in each folders). Thank you (1 Reply)
Discussion started by: mmsiddig
1 Replies

5. UNIX for Dummies Questions & Answers

Move Multiple Files adding date timestamp before file type

There are files in a directory and I have to move multiple files adding datetimestamp before the file type. /Data/ abc.csv def.csv ghi.csv I have to move this files to archive directory adding datatimestamp before .csv /archive/ abc_YYYYMMDDHHMMSS.csv def_YYYYMMDDHHMMSS.csv... (7 Replies)
Discussion started by: eskay
7 Replies

6. Shell Programming and Scripting

Sort and move multiple files by modification date

Hi I have a problem, I have a large group of archive files in a folder some are later versions of the same archive, the only difference btween them is that the archiving program we use appends the name with a code for it to keep track of in its data base, and the modification date. I am starting... (6 Replies)
Discussion started by: Paul Walker
6 Replies

7. Shell Programming and Scripting

SBATCH trinity for multiple files and rename/move the output files

Hey guys, I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output) #!/bin/bash -l #SBATCH -p node #SBATCH -A <projectID> #SBATCH -n 16 #SBATCH -t 7-00:00:00 #SBATCH --mem=128GB #SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies

8. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies

9. Shell Programming and Scripting

Move multiple files to different directory using a single command

I have multiple files test1, test2, test3 etc. I want to move to a different directory with ABC_ prefixed to every file and and current dat time as postfix using a single command. (I will be using this is sftp with ! (command for local server). I have tried the following but it gives error ... (5 Replies)
Discussion started by: Soham
5 Replies

10. Shell Programming and Scripting

Rename (move) multiple files on remote server using sftp

I want to rename (move) multiple files on remote server. I tried the following command to move all TXT files from my_dir directory to /new_dir. But it does not work. Any help? #!/bin/ksh sftp -dev3 << ABC cd my_dir $(for i in TXT; do echo "ls *.$i" ; rename $x /new_dir/$x;... (1 Reply)
Discussion started by: Soham
1 Replies
DISPLAY-DHAMMAPADA(1)					      General Commands Manual					     DISPLAY-DHAMMAPADA(1)

NAME
display-dhammapada - display a verse from the Dhammapada SYNOPSIS
display-dhammapada [-r | -m | -b | -pl] [<number> | all] dhamma [-r | -m | -b | -pl] [<number> | all] xdhamma [<number>] gtk-dhammapada OPTIONS
-r Use John Richard's translation (default) -m Use F. Max Muller's translation -b Display the same verse(s) from both -pl Use Polish language translation <number> specify the number of the verse(s) to display all display all file at once With no arguments a random verse is printed. DESCRIPTION
The Dhammapada is an anthology of 423 verses from the Kuddaka Nikaya part of the Theravada Pali Canon. It contains Buddhist ethical and spiritual precepts. One of the translations is by John Richards; the other is an older translation by F. Max Muller. Polish translation is by Zbigniew Becker. display-dhammapada prints to the standard output. xdhamma prints using xmessage on an X Window screen, or in bold using tputs on a text terminal. EXAMPLES
To display a verse each time you log in on a terminal, put display-dhammapada or xdhamma in your ~/.profile, ~/.bash_profile or ~/.login, as appropriate for your shell. To display a verse each time you log in on X Window, put xdhamma in your ~/.xsession. KDE 2.1 has "amor" toy that can display various tips. To use the dhammapada for that enter these commands at shell prompt: mkdir ~/.kde/share/apps/amor display-dhammapada -r all |perl -0777 -pe 's/ s* s* / % /g' >~/.kde/share/apps/amor/tips Then start amor K->Toys->Amor, right click on amor animation, select "Options" and select "Allow application tips" and "Show random tips". Use gtk-dhammapada to display verse in GTK window. To automatically attach Dhammapada verse in e-mail footer. To do this in mutt add set signature=display-dhammapada| in your ~/.muttrc file. FILES
/usr/share/display-dhammapada/dhammapada-english-transl.txt /usr/share/display-dhammapada/dhammapada-alternate.txt /usr/share/display-dhammapada/dhammapada-polish-transl.txt SEE ALSO
xmessage(1), tput(1). BUGS
You may found that xmessage and hence xdhamma is broken on XFree 4.0x. AUTHORS
Program: Copyright (C) January 1997-2003 by Richard Cepas <rch@online.lt> and contributors, placed in the public domain. See http://unicode.strangled.net/me/rch/dd.html Richards' English translation of the Dhammapada: Copyright (C) 1993 John Richards, Pembrokeshire (UK), permission granted for use here. See ftp://coombs.anu.edu.au/coombspapers/otherarchives/electronic-buddhist-archives/buddhism-general/e-texts/sutras-translations/dhamma- pada-english-transl.txt Muller's translation of the Dhammapada: Public Domain, used here courtesy of Project Gutenberg. Polish translation (by Zbigniew Becker): Public Domain, as explained at http://creativecommons.org/licenses/publicdomain See also http://mahajana.net/dhammapada/ late 20th century DISPLAY-DHAMMAPADA(1)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy