Sponsored Content
Top Forums Shell Programming and Scripting Issue with copying files into dir inside for loop Post 302858635 by smile689 on Tuesday 1st of October 2013 03:22:49 AM
Old 10-01-2013
Issue with copying files into dir inside for loop

Hi ,
I'm trying to move/copy the files inside the loop into a directory .
I tried the below code and the issue is the data is not copying into the created directory but the files are copying into another file

Code:
file_path="/home/etc"
 Last_Day=20130930
 
mkdir $file_path/ARC_${Last_Day}
 
  for files in $file_path/AB*$Last_Day*
  do 
    dest_dir=$ARC_${Last_Day}
    cp $file_path/$Last_Data $file_path/$dest_dir
 
   done

When i check with set -x the last cp command is interpreted as
cp /home/etc/AB_20130930.log /home/etc/20130930

Please suggest.. Thank You
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies

2. Shell Programming and Scripting

copying files to new dir

Hello, I'm new to shell scripting so I don't really understand what I'm doing wrong. The script I'm trying to do saves all the files (*.c) on the current dir to a list and, one by one, copies them to a new one called Backup. The thing is, if there are already other versions of the files I'm... (6 Replies)
Discussion started by: G3nn
6 Replies

3. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

4. UNIX for Dummies Questions & Answers

Permissions issue after copying files

Hi everyone, I am using mac os x 10.6, and I just copied over a project from a machine with 10.5... And I noticed my ls color is very funky in this directory... I found that my permissions are all messed up, and am wondering if there is a way to recursively fix permissions? This is how they... (3 Replies)
Discussion started by: patrick99e99
3 Replies

5. Shell Programming and Scripting

Copying specific files from one dir to another

Hi Folks, I have one curious case. There are list of following files placed in one directory such as... And updated each month. files.JAN09.csv files.FEB09.csv files.MAR09.csv ..... Now, I need to move a specific files; i.e, For this month, I need to move only OCT09, NOV09, DEC09,... (1 Reply)
Discussion started by: Jerald Nathan
1 Replies

6. Shell Programming and Scripting

issue while copying file dynamically whith in loop?

I need to copy the log file dynamically and that should run in loop , which means it should pick what ever the latest file is updated in that directory. I am able to display the list and copy to directly but i have no idea on how to pick the dynamically updated files. when i use this code, i... (1 Reply)
Discussion started by: johninweb
1 Replies

7. Shell Programming and Scripting

Copying files to new dir structure.

I am trying to figure out a way to script copying specific files from one dir structure to another. I have a dir structure like this: dira/author 1/book 1/file a.epub /book 2/file b.epub /author 2/book 1/file c.epub /author 3/book 1/file d.epub /book 2/file... (2 Replies)
Discussion started by: arcanas
2 Replies

8. Shell Programming and Scripting

Issue with copying files

Hi I have to write a shell script which copy files from one folder to another. When I try to do it directly from command prompt cp filename.dat /outgoing/filename.dat its working fine. But when I put the same command inside a shell script say test.sh its not getting copied. and when I check $?... (3 Replies)
Discussion started by: ravinunna
3 Replies

9. Shell Programming and Scripting

Issue with accessing value inside while loop, outside it

Hi, GetName() { if then echo " Please enter the name: " read Name tempvar=0 while read line do if then tempvar=`expr $tempvar + 1` echo $tempvar ... (10 Replies)
Discussion started by: rituparna_gupta
10 Replies

10. Shell Programming and Scripting

PERL - Copying ONLY files from one dir to another

I'm writing a Perl script which has its 1st step as to copy files from one directory to another directory. The Source directory has got files with extension, without extension, directories etc. But I want to copy ONLY files with no extension. The files with extensions and directories should not get... (2 Replies)
Discussion started by: jhamaks
2 Replies
Jifty::View::Static::Handler(3pm)			User Contributed Perl Documentation			 Jifty::View::Static::Handler(3pm)

NAME
Jifty::View::Static::Handler - Jifty view handler for static files DESCRIPTION
This is deprecated and is being port to a stack of plack middleware and plack::app::file This class takes care of serving out static files for a Jifty application. When fully operational, it will use an algorithm along the lines of the following: * Static files are served out of a separate root * If static files go through apache: * How do we merge together the N static roots? * If static files go through Jifty::Handler * We need a flag to allow them to go through the dispatcher, too * return "True" (304) for if-modified-since * if the browser accepts gzipped data, see if we have a cached gzipped copy if so, send it see if we have a marker indicating that gzip is a lose if so, send uncompressed gzip the content send the gzipped content * if the browser doesn't accept gzipped content send the content uncompressed new Create a new static file handler. Likely, only the "Jifty::Handler" needs to do this. roots Returns all the static roots the handler will search show $path Handle a request for $path. If we can't find a static file of that name, return undef. handle_request $path An alias for "show" file_path $path Returns the system path for $path, searching inside the application's static root, loaded plugins' static roots, and finally Jifty's static root. Returns undef if it can't find the file in any path. template_exists $path An alias for "file_path". mime_type $path Returns the mime type of the file whose path on disk is $path. Tries to use MIME::Types to guess first. If that fails, it falls back to "File::MMagic". send_file $path $mimetype Print $path to STDOUT (the client), identified with a mimetype of $mimetype. send_http_header [COMPRESSION, LENGTH, LAST_MODIFIED] Sends appropriate cache control and expiration headers such that the client will cache the content. COMPRESSION is deprecated send_not_modified Sends a "304 Not modified" response to the browser, telling it to use a cached copy. perl v5.14.2 2010-09-25 Jifty::View::Static::Handler(3pm)
All times are GMT -4. The time now is 06:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy