Sponsored Content
Top Forums Shell Programming and Scripting Copy Files to Dir and Check If File Exists Post 302403466 by snag49ers on Friday 12th of March 2010 03:20:30 PM
Old 03-12-2010
Copy Files to Dir and Check If File Exists

Hi everyone. I am trying to write a bash script that will copy files from one directory to another but I need to be able to check the directory that I'm copying the files to and see if the file already exists. If it does I need to add a number at the end of the copied file. Thanks for your help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to copy N files from one dir to another

Hi, I have a script that can only handLE limited number of input files. I need to be able to write a command (or a script) that: 1> copies N number of files from one directory (A) to another (B). 2> Files that are moved need to be renamed. 3> Files picked to be moved have... (1 Reply)
Discussion started by: GMMike
1 Replies

2. Shell Programming and Scripting

copy files from one dir to another

Hi , I want to copy files from one dir to anothe dir and check if destination dir exists ,if not exist ,has to create but when executing the below schell script ,the destination directory not exist and exit the shell script. #!/bin/sh src_path=/home/owngdw/abc tgt_path=/home/owngdw/abc/xyz if... (6 Replies)
Discussion started by: mohan705
6 Replies

3. Shell Programming and Scripting

How to check a file exist and do a copy of other files

Hi, I would like to perform bash which would check the file A.txt to be size 0 or not. If the size is 0, I would copy file B.txt to replace A.txt. Please help. Thanks. -Jason (6 Replies)
Discussion started by: ahjiefreak
6 Replies

4. Shell Programming and Scripting

How to copy specified files from list of files from dir A to dir B

Hello, fjalkdsjfkldsajflkajdskl (3 Replies)
Discussion started by: pmeesara
3 Replies

5. Shell Programming and Scripting

Copy files from input file with dir structure

hi, I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE. Note that i will have other files and directories which i dont want to copy to destination. For example, dir source has following content:... (22 Replies)
Discussion started by: dragon.1431
22 Replies

6. Shell Programming and Scripting

Copy files and subdirs from dir to a new dir

Hello Comunity I am trying to make a bash shell script that it copies files and subdirs(with files) to a new dir. I would like the dest_dir to contain only subdirectories with files not other subdirs inside. it called : cpflatdir src_dir dest_dir Pleaze help me! Thank you in... (2 Replies)
Discussion started by: BTKBaaMMM
2 Replies

7. Shell Programming and Scripting

diff script to copy files to other dir when not exists

I have two directories that are mostly the same: dir1 dir2 Is there an easy way to take the output of diff and copy files from dir1 that do not exist in dir2 - but copy them to the same path (many nested directories). am only trying to copy files in dir1 that do not exist in dir2. ... (5 Replies)
Discussion started by: jvsrvcs
5 Replies

8. Shell Programming and Scripting

Perl code to check date and check files in particular dir

Hi Experts, I am checking how to get day in Perl. If it is “Monday” I need to process…below is the pseudo code. Can you please prove the code for below condition. if (today=="Monday" ) { while (current_time LESS THAN 9:01 AM) ... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

9. Shell Programming and Scripting

Shell script which will check the target file and folder exists and copy it

Hi All, I am a beginner in this and trying to write a shell script in linux which will : 1. Ask for a file name and check if its exists. 2. If file exists only then it will ask for the new target folder, after entering target folder name it will check if it exists. 3. If target folder... (3 Replies)
Discussion started by: ashish_neekhra
3 Replies

10. Shell Programming and Scripting

How to check more than 1 file specified files exists?

Hi all, One of my script crated created 2 files in a dirs Output.log and Output.tmp. Now in another script i need to check if both of the above mentioned files are present in a directory or not. I know to check one file but need to check both the files. Anyone could please tell me how... (3 Replies)
Discussion started by: girijajoshi
3 Replies
TAGS(3erl)						     ERLANG MODULE DEFINITION							TAGS(3erl)

MODULE
tags - Generate Emacs TAGS file from Erlang source files. DESCRIPTION
A TAGS file is used by Emacs to find function and variable definitions in any source file in a big project. This module can generate a TAGS file from Erlang source files. It recognises functions, records, and defines. EXPORTS
root([Options]) Create a TAGS file covering all files in the Erlang distribution. file(File [, Options]) Create a TAGS file for the file `File'. files(FileList [, Options]) Create a TAGS file for the files in the list `FileList'. dir(Dir [, Options]) Create a TAGS file for all files in directory `Dir'. dirs(DirList [, Options]) Create a TAGS file for all files in any directory in `DirList'. subdir(Dir [, Options]) Descend recursively down the directory `Dir' and create a TAGS file based on all files found. subdirs(DirList [, Options]) Descend recursively down all the directories in `DirList' and create a TAGS file based on all files found. OPTIONS
The functions above have an optional argument, Options. It is a list which can contain the following elements: {outfile, NameOfTAGSFile} Create a TAGS file named `NameOfTAGSFile'. {outdir, NameOfDirectory} Create a file named TAGS in the directory `NameOfDirectory'. The default behaviour is to create a file named "TAGS" in the current directory. SEE ALSO
GNU Emacs Manual, chapter "Editing Programs", section "Tag Tables". Erlang mode V2.0 for Emacs. AUTHOR
Anders Lindgren Ericsson Software Technology 1996-05-30 TAGS(3erl)
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy