f



Copy modified files from one directory to another.

Hi,

Two directories with same content exist on the unix box. Some of the
content of one directory keeps on changing over time. I have to write
a shell script to update the other directory with the changes. Problem
is to copy only the changed/modified files to the other directory
(maintaining the directory structure). How can this be achieved using
simple shell script?

Thanks,

0
2/7/2007 11:16:16 PM
comp.unix.shell 15484 articles. 3 followers. Post Follow

9 Replies
575 Views

Similar Articles

[PageSpeed] 14

On 7 Feb 2007 15:16:16 -0800, mizwam 
  <mail.manasi.sharma@gmail.com> wrote:
>
>
> Hi,
>
> Two directories with same content exist on the unix box. Some of the
> content of one directory keeps on changing over time. I have to write
> a shell script to update the other directory with the changes. Problem
> is to copy only the changed/modified files to the other directory
> (maintaining the directory structure). How can this be achieved using
> simple shell script?
>
rsync


-- 
Nothing is so often irretrievably missed as a daily opportunity.
		-- Ebner-Eschenbach
0
Bill
2/7/2007 11:32:32 PM
On Feb 7, 6:32 pm, Bill Marcum <marcumb...@bellsouth.net> wrote:
> On 7 Feb 2007 15:16:16 -0800, mizwam  <mail.manasi.sha...@gmail.com> wrote:
>
> > Hi,
>
> > Two directories with same content exist on the unix box. Some of the
> > content ofonedirectorykeeps on changing over time. I have to write
> > a shell script to update the otherdirectorywith the changes. Problem
> > is tocopyonly the changed/modifiedfilesto the otherdirectory
> > (maintaining thedirectorystructure). How can this be achieved using
> > simple shell script?
>
> rsync
>
> --
> Nothing is so often irretrievably missed as a daily opportunity.
>                 -- Ebner-Eschenbach


Thanks Bill but I am not allowed to install any new utility (like
rsync) on the unix box. I was looking for a more basic way - maybe
iterating through the directories and comparing the contents etc.

0
mizwam
2/8/2007 3:28:09 AM
mizwam :
> On Feb 7, 6:32 pm, Bill Marcum <marcumb...@bellsouth.net> wrote:
>> On 7 Feb 2007 15:16:16 -0800, mizwam  <mail.manasi.sha...@gmail.com> wrote:
>>
>>> Hi,
>>> Two directories with same content exist on the unix box. Some of the
>>> content ofonedirectorykeeps on changing over time. I have to write
>>> a shell script to update the otherdirectorywith the changes. Problem
>>> is tocopyonly the changed/modifiedfilesto the otherdirectory
>>> (maintaining thedirectorystructure). How can this be achieved using
>>> simple shell script?
>> rsync
>>
>> --
>> Nothing is so often irretrievably missed as a daily opportunity.
>>                 -- Ebner-Eschenbach
> 
> 
> Thanks Bill but I am not allowed to install any new utility (like
> rsync) on the unix box. I was looking for a more basic way - maybe
> iterating through the directories and comparing the contents etc.
Then you are reinventing another rsync.
You can install your rsync in your own home dir, I think nobody will
constrain you from doing that!
0
Bo
2/8/2007 5:23:13 AM
here is the solution:
let us consider A contains additional files than B.
1) Get the last modfied timestamp from B
2) find the newer files in A using the command
   find -newer [last_modified_timestamp]
3) Copy those files

all these can be achieved through simple 3 line shell script.
Please let me know if you need more details.
Thanks,
Siva

On Feb 8, 10:23 am, Bo Yang <strug...@mail.nankai.edu.cn> wrote:
> mizwam :
>
> > On Feb 7, 6:32 pm, Bill Marcum <marcumb...@bellsouth.net> wrote:
> >> On 7 Feb 2007 15:16:16 -0800, mizwam  <mail.manasi.sha...@gmail.com> wrote:
>
> >>> Hi,
> >>> Two directories with same content exist on the unix box. Some of the
> >>> content ofonedirectorykeeps on changing over time. I have to write
> >>> a shell script to update the otherdirectorywith the changes. Problem
> >>> is tocopyonly the changed/modifiedfilesto the otherdirectory
> >>> (maintaining thedirectorystructure). How can this be achieved using
> >>> simple shell script?
> >> rsync
>
> >> --
> >> Nothing is so often irretrievably missed as a daily opportunity.
> >>                 -- Ebner-Eschenbach
>
> > Thanks Bill but I am not allowed to install any new utility (like
> > rsync) on the unix box. I was looking for a more basic way - maybe
> > iterating through the directories and comparing the contents etc.
>
> Then you are reinventing another rsync.
> You can install your rsync in your own home dir, I think nobody will
> constrain you from doing that!


0
swami
2/8/2007 7:21:19 AM
On Feb 8, 2:21 am, "swami" <sivaswamim...@gmail.com> wrote:
> here is the solution:
> let us consider A contains additionalfilesthan B.
> 1) Get the last modfied timestamp from B
> 2) find the newerfilesin A using the command
>    find -newer [last_modified_timestamp]
> 3)Copythosefiles
>
> all these can be achieved through simple 3 line shell script.
> Please let me know if you need more details.
> Thanks,
> Siva
>

Thanks Siva, this won't work since both the directories A and B are
checked out from different Configuration management systems (Synergy
CM and PVCS), and my aim to make sure that both are in sync. As soon
as i check out - the time of checking out becomes the time of
modification. What i am looking for is a way to compare the content in
the files. Check out from PVCS store in directory A and Checkout from
Synergy CM stored in directory B. Copy A to B - copy only those files
that have changed. Any ideas?


0
mizwam
2/8/2007 8:13:58 PM
In this case, The following options can help you

1) You can check out to specific directories created by you by the
script.
and you can easily migrate the files within that directory.

for eg:

A /My <----------- checked out files
cp A/My B
cp  A /My  A

Similarly this can be done for the B Directory

2) You can get the Listing of directory through ls -l > List
after the directory has been updated you can compare the directory
Structure with the List file.
if the file is newer you can copy the file to the B directory.

3) You can use the access time of the files. but care must be taken
that no ls -l is performed on the directory.



On Feb 9, 1:13 am, "mizwam" <mail.manasi.sha...@gmail.com> wrote:
> On Feb 8, 2:21 am, "swami" <sivaswamim...@gmail.com> wrote:
>
> > here is the solution:
> > let us consider A contains additionalfilesthan B.
> > 1) Get the last modfied timestamp from B
> > 2) find the newerfilesin A using the command
> >    find -newer [last_modified_timestamp]
> > 3)Copythosefiles
>
> > all these can be achieved through simple 3 line shell script.
> > Please let me know if you need more details.
> > Thanks,
> > Siva
>
> Thanks Siva, this won't work since both the directories A and B are
> checked out from different Configuration management systems (Synergy
> CM and PVCS), and my aim to make sure that both are in sync. As soon
> as i check out - the time of checking out becomes the time of
> modification. What i am looking for is a way to compare the content in
> the files. Check out from PVCS store in directory A and Checkout from
> Synergy CM stored in directory B. Copy A to B - copy only those files
> that have changed. Any ideas?


0
swami
2/9/2007 5:46:02 PM
On Wed, 07 Feb 2007 15:16:16 -0800, mizwam wrote:

> Hi,
> 
> Two directories with same content exist on the unix box. Some of the
> content of one directory keeps on changing over time. I have to write a
> shell script to update the other directory with the changes. Problem is to
> copy only the changed/modified files to the other directory (maintaining
> the directory structure). How can this be achieved using simple shell
> script?


#mind the line wrap:

user@ops:~
$ crontab -l
0 0 * * * date >> /pub/home/user/Log/cron.log ; cp -Ruxv /NewServer/* /home/user/Server >> /pub/home/user/Log/cron.log
user@ops:~
$

Cheers!
Rich

0
Rich
2/14/2007 11:13:00 PM
On Feb 14, 6:13 pm, Rich Grise <r...@example.net> wrote:
> On Wed, 07 Feb 2007 15:16:16 -0800, mizwam wrote:
> > Hi,
>
> > Two directories with same content exist on the unix box. Some of the
> > content ofonedirectorykeeps on changing over time. I have to write a
> > shell script to update the otherdirectorywith the changes. Problem is to
> >copyonly the changed/modifiedfilesto the otherdirectory(maintaining
> > thedirectorystructure). How can this be achieved using simple shell
> > script?
>
> #mind the line wrap:
>
> user@ops:~
> $ crontab -l
> 0 0 * * * date >> /pub/home/user/Log/cron.log ; cp -Ruxv /NewServer/* /home/user/Server >> /pub/home/user/Log/cron.log
> user@ops:~
> $
>
> Cheers!
> Rich

Hi Rich,

Can you explain to me the code that you have written. I couldn't
understand it at all - i am new to unix shell.

Thanks,

0
mizwam
2/19/2007 5:51:58 PM
On 19 Feb 2007 09:51:58 -0800, mizwam wrote:

> Can you explain to me the code that you have written. I couldn't
> understand it at all - i am new to unix shell.

Append date/time to bottom of /pub/home/user/Log/cron.log with
       date >> /pub/home/user/Log/cron.log
do a
   man cp
to understand the rest of the script.

Some light reading found at
http://tldp.org/LDP/abs/html/index.html
0
Bit
2/19/2007 9:38:44 PM
Reply:

Similar Artilces:

Script to move files with one occurence of a string to one directory, and other files to another directory?
I could use a script for the bash shell to look through a group of files (s= elected from one directory by a wildcard expression) and move any of those = files with exactly one occurrence of the string Path: to a different direct= ory, usually a subdirectory of the first directory. The rest of the files = selected by the wildcard expression are move to a third directory, also usu= ally a subdirectory of the first directory. I'm currently doing this manua= lly, but with grep commands to count the number of occurrences. NOT homework - I'm retired. Actually using Cygwin (an em...

Copy files and folders from one directory into another
I have files in myurl.com/myfolder and I would like to copy all of them into myurl.com/newfolder I'd like to copy all of the subdirectories and files that are in /myfolder and I would like to be able to use a form of some sort to name the file I want to copy, and create the folder I'd like to copy it to, such as newfolder. How can I use a form to create a new folder on the server? How can I use a form to name the old folder I want to copy everything from, then create the name of the new folder I want to copy everything into, and then copy? If anyone can help, I'd be VERY appricative. Thank you. In article <7383558c.0405211340.231be283@posting.google.com>, Frank wrote: > I have files in myurl.com/myfolder > > and I would like to copy all of them into > > myurl.com/newfolder Now, why don't you just rename myfolder to newfolder? in php something like system('mv myfolder newfolder'); and probably there are some native php functions too... -- Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php> ...

Copy a file from one directory to another from a SAS program?
Is there a way from SAS to copy a file from one directory to another? = I am exporting 200+ sheets from an Excel 2007 workbook and there is one = sheet that I do not want to process like the others, so I'd like to move = it in my SAS program to another folder. -Mary ...

Simple shell Script to copy file from one location to another
Hello people I am new to this group and wondering if any one has a simple script which copies the file from one location to another location on the same server. Thanks -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mehdi wrote: > Hello people > > I am new to this group and wondering if any one has a simple script > which copies the file from one location to another location on the same > server. The simplest way is to use the cp(1) command. Are you certain that you want a script for this? - -- Lew Pitcher, IT Specialist, Corporate Technology Solutions, Enterprise Technology Solutions, TD Bank Financial Group (Opinions expressed here are my own, not my employer's) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBeR1agVFX4UWr64RAipiAJ4sLeMlxZUA6NgphN59y3VFRZKsRACfarbO 8cWcJaG/UkSopZkGxdI2uDM= =ihP4 -----END PGP SIGNATURE----- >I am new to this group and wondering if any one has a simple script >which copies the file from one location to another location on the same >server. What about the 'cp' command isn't sufficient for your purposes? Most systems have more than a single "THE file". And if you're intending to copy it, you'll end up with at least 2 files. Gordon L. Burditt ...

Re: Copy a file from one directory to another from a SAS program?
If you know the file names, you can do the 'X' command at some point to execute a system command to move the file: X "move /path/to/original /path/to/dest"; If you are on Windows (probably, since you are using .xls). Otherwise, whatever command is native to your OS for moving files should work within your 'X' command. Matt -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mary Sent: Thursday, July 31, 2008 2:05 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Copy a file from one directory to another from a SAS program? Is there a way from SAS to copy a file from one directory to another? I am exporting 200+ sheets from an Excel 2007 workbook and there is one sheet that I do not want to process like the others, so I'd like to move it in my SAS program to another folder. -Mary ...

Re: Copy a file from one directory to another from a SAS program? #2
Yes, that does work X "move c:\dir1\test.txt c:\dir2\test.txt" It is however, leaving open the DOS command window. I tried: X "exit"; and that did not work to close it. Would anyone know how to close it? -Mary ----- Original Message -----=20 From: matt.pettis@thomsonreuters.com=20 To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, July 31, 2008 2:58 PM Subject: RE: Copy a file from one directory to another from a SAS = program? If you know the file names, you can do the 'X' command at some point = to execute a system command to move the file: X "move /path/to/original /path/to/dest"; If you are on Windows (probably, since you are using .xls). = Otherwise, whatever command is native to your OS for moving files should work within your 'X' command. Matt -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mary Sent: Thursday, July 31, 2008 2:05 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Copy a file from one directory to another from a SAS program? Is there a way from SAS to copy a file from one directory to another? I am exporting 200+ sheets from an Excel 2007 workbook and there is = one sheet that I do not want to process like the others, so I'd like to = move it in my SAS program to another folder. -Mary ...

Re: Copy a file from one directory to another from a SAS program? #9
Mary; You got lots of suggestions for the use of the X statement. Might I suggest, instead, the use of the %sysExec statement. This uses the exact system command without the necessity of quoting the string like you have to do with the X command. %sysExec move c:\dir1\test.txt c:\dir2\ /y ; Notice that we have no quotes. Now, I often work with people who set up directory structures that have embedded spaces in the folder names. So %sysExec allows me to code something like... %sysExec move "\\server\the first dir\test.txt" "\\server\the second dir\" /y ; with the double-quotes that Windows wants. I can very easily then move to macro variables as my skills improve. %let dir1 = \\server\the first dir ; %let dir2 = C:\dir2 ; .... %sysExec move "&dir1\test.txt" "dir2" /y ; Now, if I'm already more advanced and am working in a macro which allows use of the %if statement, I can use the system() function inside the %sysFunc() function to enable error handling. Something like... %if ( %sysFunc( system( move "&dir1\test.txt" "dir2" /y ) ) gt 0 ) %then %do ; %put ERROR: text.txt was not moved from &dir1 to &dir2! ; %put ERROR- Processing was stopped for this macro. ; %return ; %end ; Of course, you will still want to use... Options noXWait ; Okay, I'll talk off my teacher hat! Ed Edward Heaton, Senior Systems Analyst, Westat (An Employee-Owned Research Corporatio...

Re: Copy a file from one directory to another from a SAS program? #7
Mary, You could, of course, simply not confront the dos window with something like: data _null_; systask command "move c:\dir1\test.txt c:\dir2"; run; Art --------- On Thu, 31 Jul 2008 15:12:12 -0500, Mary <mlhoward@AVALON.NET> wrote: >Yes, that does work >X "move c:\dir1\test.txt c:\dir2\test.txt" > >It is however, leaving open the DOS command window. I tried: >X "exit"; >and that did not work to close it. Would anyone know how to close it? > >-Mary > ----- Original Message ----- > From: matt.pettis@thomsonreuters.com > To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU > Sent: Thursday, July 31, 2008 2:58 PM > Subject: RE: Copy a file from one directory to another from a SAS program? > > > If you know the file names, you can do the 'X' command at some point to > execute a system command to move the file: > > X "move /path/to/original /path/to/dest"; > > If you are on Windows (probably, since you are using .xls). Otherwise, > whatever command is native to your OS for moving files should work > within your 'X' command. > > Matt > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Mary > Sent: Thursday, July 31, 2008 2:05 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Copy a file from one directory to another from a SAS program? > > Is there a...

Re: Copy a file from one directory to another from a SAS program? #4
hi ... try this before using the X command ... options noxwait; "NOXWAIT specifies that the command processor automatically returns to the SAS session after the specified command is executed. You do not have to type EXIT." the online doc has a good explanation of XWAIT and XSYNC (sounds like EXTINCT, hmmm... DOS) -- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475 > Yes, that does work > X "move c:\dir1\test.txt c:\dir2\test.txt" > > It is however, leaving open the DOS command window. I tried: > X "exit"; > and that did not work to close it. Would anyone know how to close it? > > -Mary > ----- Original Message ----- > From: matt.pettis@thomsonreuters.com > To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU > Sent: Thursday, July 31, 2008 2:58 PM > Subject: RE: Copy a file from one directory to another from a SAS program? > > > If you know the file names, you can do the 'X' command at some point to > execute a system command to move the file: > > X "move /path/to/original /path/to/dest"; > > If you are on Windows (probably, since you are using .xls). Otherwise, > whatever command is native to your OS for moving files should work > within your 'X' command. > > Matt > > -----Original Message----- > From: SAS(r) Discussion [mailto:...

Re: Copy a file from one directory to another from a SAS program? #3
Check out the system options XWAIT|NOXWAIT and XSYNC and NOXSYNC from the online document. I think options noxwait might do it for you. HTH, -TJ On Thu, 31 Jul 2008 15:12:12 -0500, Mary <mlhoward@AVALON.NET> wrote: >Yes, that does work >X "move c:\dir1\test.txt c:\dir2\test.txt" > >It is however, leaving open the DOS command window. I tried: >X "exit"; >and that did not work to close it. Would anyone know how to close it? > >-Mary > ----- Original Message ----- > From: matt.pettis@thomsonreuters.com > To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU > Sent: Thursday, July 31, 2008 2:58 PM > Subject: RE: Copy a file from one directory to another from a SAS program? > > > If you know the file names, you can do the 'X' command at some point to > execute a system command to move the file: > > X "move /path/to/original /path/to/dest"; > > If you are on Windows (probably, since you are using .xls). Otherwise, > whatever command is native to your OS for moving files should work > within your 'X' command. > > Matt > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Mary > Sent: Thursday, July 31, 2008 2:05 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Copy a file from one directory to another from a SAS program? > > Is there a way from SAS to copy a file f...

Re: Copy a file from one directory to another from a SAS program? #5
try before the statement: =20 options noxwait; =20 shouldn't matter, but after the 'x' statement, you may want to turn the option back on (i personally never do) with: =20 options xwait; =20 hth, matt ________________________________ From: Mary [mailto:mlhoward@avalon.net]=20 Sent: Thursday, July 31, 2008 3:12 PM To: Pettis, Matthew (Prof II&RS); SAS-L@LISTSERV.UGA.EDU Subject: Re: Copy a file from one directory to another from a SAS program? Yes, that does work X "move c:\dir1\test.txt c:\dir2\test.txt" =20 It is however, leaving open the DOS command window. I tried: X "exit"; and that did not work to close it. Would anyone know how to close it? =20 -Mary ----- Original Message -----=20 From: matt.pettis@thomsonreuters.com=20 To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, July 31, 2008 2:58 PM Subject: RE: Copy a file from one directory to another from a SAS program? If you know the file names, you can do the 'X' command at some point to execute a system command to move the file: =09 X "move /path/to/original /path/to/dest"; =09 If you are on Windows (probably, since you are using .xls). Otherwise, whatever command is native to your OS for moving files should work within your 'X' command. =09 Matt =09 -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV....

Re: Copy a file from one directory to another from a SAS program? #6
It may be easier to not create the TXT file than to delete it later. put +6 'If objsheet.name <> "Sheet2" Then'; put +9 'WScript.echo i & " " & objsheet.name & " saving as TXT"'; put +9 'objSheet.SaveAs txtout & "\" & objSheet.name & ".txt", xlTextMSDOS'; put +9 'End If'; How do you determine the name of the unwanted sheet? On 7/31/08, Mary <mlhoward@avalon.net> wrote: > Yes, that does work > X "move c:\dir1\test.txt c:\dir2\test.txt" > > It is however, leaving open the DOS command window. I tried: > X "exit"; > and that did not work to close it. Would anyone know how to close it? > > -Mary > ----- Original Message ----- > From: matt.pettis@thomsonreuters.com > To: mlhoward@avalon.net ; SAS-L@LISTSERV.UGA.EDU > Sent: Thursday, July 31, 2008 2:58 PM > Subject: RE: Copy a file from one directory to another from a SAS program? > > > If you know the file names, you can do the 'X' command at some point to > execute a system command to move the file: > > X "move /path/to/original /path/to/dest"; > > If you are on Windows (probably, since you are using .xls). Otherwise, > whatever command is native to your OS for moving files should work > within your 'X' command. > > Matt > > -----Original Mes...

Re: Copy a file from one directory to another from a SAS program? #8
I do want the sheet, but I have one sheet that has "patient level" = things and all the rest of the sheets are visit level, one sheet for = every patient in my patient level (theoretically, but I now can check = for that). So after I export all the sheets, I just copy off the one = sheet with the patient level stuff out of the directory, then I can use = the code worked out last week for Rodney Presley to read in all the = other sheets and put them all into one dataset. I an loading the data = from there to Oracle Express (we are going to get the standard version = soon), as two related tables; a patient level table that is a one to = many join with a visit level table, where the patient is a foreign key = on the visit table. =20 It is working great! Yes,=20 options noxwait;=20 did the trick on closing the DOS window automatically.=20 Thanks all. -Mary ----- Original Message -----=20 From: data _null_,=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, July 31, 2008 3:41 PM Subject: Re: Copy a file from one directory to another from a SAS = program? It may be easier to not create the TXT file than to delete it later. put +6 'If objsheet.name <> "Sheet2" Then'; put +9 'WScript.echo i & " " & objsheet.name & " saving as = TXT"'; put +9 'objSheet.SaveAs txtout & "\" & objSheet.name & ".txt", xlTextMSDOS'; put +...

Reg: Copy records from one file to another based on contents of a third file.
Hi, Suppose I have a simple flat-file, say File-C which contains just one field: Name of a person. File-A contains many records one of which is Name. Now I wish to copy all records from File-A to a new File-B only if the Name present in the record of File-A is availble in the list of Names in File-C. Can we use File Aid JCL (or Insync) to do this or any form of JCL to achieve this..?? I wish to avoid writing a cobol program which can of course achieve this. Thanks... mail_ssb@yahoo.com (ssb) wrote: >Suppose I have a simple flat-file, say File-C which contains just one >field: Nam...

Copying a file into another directory
Hi What is the established way of copying a file/dir into another dir in Java? I was looking into 'java.io' package, but could only find a renameTo() method. It looks like it only renames the file or at the moves the same file to the destination dir. Please advice Thanks Sahil On 08-10-2010 08:03, Sahil Dave wrote: > What is the established way of copying a file/dir into another dir in > Java? > I was looking into 'java.io' package, but could only find a renameTo() > method. It looks like it only renames the file or at the moves the > same fi...

To copy a folder in one directory to another
Hi I want to copy a folder from one directory to another using fcopy, it is showing error. My code is cd d:\trf\gh set file1 sah cd d:\trf\gh\iu set file2 asd fcopy $file1 $file2 sah and asd are 2 folders. Is there any command to copy a folder .Iam new to tcl.Any ldea where Iam wrong. Sunitha "sunitha.sadasivan@wipro.com" wrote: > > Hi > > I want to copy a folder from one directory to another using fcopy, it > is showing error. > > My code is > cd d:\trf\gh > set file1 sah > cd d:\trf\gh\iu > set file2 asd > fcopy $file1 $file2 > > sah and asd are 2 folders. > > Is there any command to copy a folder .Iam new to tcl.Any ldea where > Iam wrong. > > Sunitha Well, the problem is that you changed the working directory: the relative path in file1 is no longer valid then (or would point to a different directory). Try: cd d:/trf/gh set file1 [file join [pwd] sah] ;# To make the path absolute (independent of the working directory) cd d:/trf/gh/iu set file2 asd fcopy $file1 $file2 (file2 still points to the right directory, but after another cd, it will not ...) Regards, Arjen Hi Sunitha, Sunitha writes: > My code is > cd d:\trf\gh > set file1 sah Arjen explained the bit about [cd]. In short, try to avoid it. Your next problem is that you are using backslashes \ as directory separators. In Tcl script code the backslash is the escape character where e.g. \t is TAB and \n is NEWLINE. Y...

Writing or copying file to another directory
I have a simple form mailing script that I've added to. I can get the results formatted in HTML sent to stdout to appear on the new web page in the IE8 browser, and I can write the same to a file in the cgi-bin directory, which is "output.htm" and chdir 777. But I want to write the file in the directory where the HTML for the submit form is located, and nothing seems to work. Here is the script with things I tried. I have searched the docs and FAQs and online but nothing seems to work for a different directory, which also has the files with 777 permissions. The HTML with JavaScript is live at http://www.smart.net/~pstech/SCGBG/EventSubmitJS.htm It checks the Full Name entry as a simple password. The correct name as coded below will actually send an email to me. Any help will be appreciated. Thanks! Paul ---------------------------------------------------------------------- #!/usr/bin/perl # # mailer.pl-- A simple program to mail form data to an email address # # Written in 1997 by James Marshall, james@jmarshall.com # For the latest, see http://www.jmarshall.com/easy/cgi/ # # IMPORTANT: MAKE SURE THESE TWO VALUES ARE SET CORRECTLY FOR YOU! # This is the location in smart.net $mailprog= "/usr/bin/sendmail" ; $recipient= "paul\@peschoen.com" ; # make sure to \ escape the @ # Get the CGI input variables %in= &getcgivars ; if($in{'Full_Name'} ne 'Paul E. Schoen') { &HTMLdie("Unauthori...

Copying a file to another file
Hi, I wrote the following C program to copy a file to another file. #include <stdio.h> #include <stdlib.h> static FILE *open_file ( char *file, char *mode ) { FILE *fp = fopen ( file, mode ); if ( fp == NULL ) { perror ( "Unable to open file" ); exit ( EXIT_FAILURE ); } return fp; } int main ( int argc, char *argv[] ) { /* int ch;*/ FILE *from; FILE *to; char *buffer; long lSize; if ( argc != 3 ) { fprintf ( stderr, "Usage: %s <readfile1> <writefile2>\n", argv[0] ); exit (1);/* E...

Include a latex file with one style, into another tex file with another style.
List, I need to include a resume (latex) file which I wrote using the resume.sty into another LaTeX file that is in book style. I've never have to include a tex file with different documentclass/style inside another one. Any suggestions ??? Thanks in advance. PG.- On Mar 29, 9:36 pm, pgarra...@gmail.com wrote: > List, > I need to include a resume (latex) file which I wrote using the > resume.sty into another LaTeX file that is in book style. I've never > have to include a tex file with different documentclass/style inside > another one. The best thing to do here would be to make a .pdf or .eps of the r=E9sum=E9 and place it as a graphic. William pgarralda@gmail.com writes: > List, > I need to include a resume (latex) file which I wrote using the > resume.sty into another LaTeX file that is in book style. I've never > have to include a tex file with different documentclass/style inside > another one. > > Any suggestions ??? Insert the output of your resum=E9 into your document with pdfpages. I think that's the easiest way. Or try one of the solutions given in http://www.tex.ac.uk/cgi-bin/texfaq2html?label=3Dmultidoc . HTH Ulrich ...

Finding and copying the last modified file in a directory
I am hoping to be able to find the last modified file in a directory and copy it to another directory under a different name. I have so far been trying to find a way to use the 'find' command followed by the '-exec'. Unfortuately I cannot find an option that finds the last modified file. I would be grateful to hear any suggestions. On 24 Oct 2006 10:01:49 -0700, mark.pollard@cwfi.co.fk wrote: >I am hoping to be able to find the last modified file in a directory >and copy it to another directory under a different name. I have so far >been trying to find a way to use...

copying programs/files from one partition to another
What is the easiest way to copy programs or files from one partition to another on an i5. Both are at V5R4, however, they each have a different tape drive model. Thanks, ga ga nospam@nospam.fmctc.com il 02/04/2009 17.35, Scrive ga 43502696: > What is the easiest way to copy programs or files from one partition > to another on an i5. Both are at V5R4, however, they each have a > different tape drive model. > > Thanks, > ga > > ga > nospam@nospam.fmctc.com Assuming you have a virtual lan betwenn partition, if you have Object Connect (that's an OS400 free opton) installed on both partitions you can use SAVRST* commands. Otherwise you can ftp save-files or copy save-files to the remote directory created into /QFileSvr.400 file-system using cpytostmf command and restore them with cpyfrmstmf command. With V5R4 you can also create a virtual tape or dvd that uses a stream file as data holder. If you need to copy objects between partitions on regular basis, I think the 1st method would be the best. -- Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherA�ejoAlcoolInside Spaccamaroni andate a cagare/Spammers not welcome/Spammers v�o � merda Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac' On Apr 2, 11:35=A0am, ga <noem...@spam.fmctc.com> wrote: > What is the easiest way to copy programs or files from one partition > to another on an i5. Both a...

Re: Copying directories or files one at a time.
* An ongoing debate between Thomas 'skip' Hollowell and All rages on ... | TH> I have a USB external drive, and I have been having issues with it | TH> when copying large amount of data (say more than 100MB) at a time, so | TH> I am trying a new approach. | TH> Anyone have any ideas on how to approach the problem of listing all | TH> the directories and files in those dirs, and then copying each file, | TH> one at a time, over to another place? dir d:\Path /a /b /s >file.lst 4dos /c copy /g /s /u @file.lst d:\Destination 4DOS is now free, great progr...

copy config files from one box to another
Hello, I have a small but urgent programming task to attend to. Must write a perl prog, on redhat AS 3.8 to grab a table from a remote db and create some (config) files - no problem. These config files need to be fed to an application on another redhat AS 3.8 box. So two subtasks, transfer config files across and restart app so the app reads the config files. There are identical non-root users on both boxes. And ssh, which I suppose is the only way to go, is configured as standard. I can restart the app with a local shell script no problem. I have done a man ssh and man scp but cannot quite see an easy way of doing this! Anyone care to help? TIA Tony On Wed, 26 Sep 2007 02:51:27 -0700, ton de w wrote: > Hello, > I have a small but urgent programming task to attend to. Must write a > perl prog, on redhat AS 3.8 to grab a table from a remote db and create > some (config) files - no problem. These config files need to be fed to > an application on another redhat AS 3.8 box. > So two subtasks, transfer config files across and restart app so the app > reads the config files. > > There are identical non-root users on both boxes. And ssh, which I > suppose is the only way to go, is configured as standard. I can restart > the app with a local shell script no problem. I have done a man ssh and > man scp but cannot quite see an easy way of doing this! > > Anyone care to help? > > TIA > > Tony Well, if you must write a ...

Re: Copy from one directory in SAS to another,
The following code copy all files from c:\temp\v2 to c:\temp\v1, in the meantime, add a prefix 'xx' to all the new file names. filename allname pipe "dir/b c:\temp\v2\*.*"; options noxwait; data _null_; infile allname; input; file "c:\temp\renameall.bat"; put 'copy c:\temp\v2\' _infile_ ' c:\temp\v1\xx' _infile_; run; x "c:\temp\renameall.bat"; You can make it a macro very easily. On Mon, 22 Jan 2007 11:22:14 -0500, Jake Bee <johbee@GMAIL.COM> wrote: >Does anyone have any ideas on how to copy files from >one directory to another, using SAS, in DOS, but >with renaming the new file in the new directory. >(The new file name has the first 6 bytes removed.) > >Thanks for any ideas! > >Jake ...

Web resources about - Copy modified files from one directory to another. - comp.unix.shell

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Telephone directory - Wikipedia, the free encyclopedia
"Phone book" and "White pages" redirect here. For a contact list, see Contact list . For other uses, see White pages (disambiguation) . Subscriber ...

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Don't call us: Centrelink bosses remove phone numbers and email from directory
Tom was savvy enough to take his complaints straight to Centrelink management.

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

Slack announces App Directory store
... create more apps for the store, and a new framework called Botkit which should simplify the process of creating apps. The Slack App Directory, ...

Amazon brings Microsoft users into AWS with Active Directory service
Amazon has launched an AWS Directory Service for Active Directory , a fully managed implementation of Microsoft's authentication and user management ...

Hackers leak DHS staff directory, claim DOJ is next
On Sunday, an account on Twitter posted a Department of Homeland Security staff directory with 9,355 names. Shortly after the DHS data was posted, ...

Resources last updated: 3/29/2016 1:58:05 AM