Sponsored Content
Top Forums Shell Programming and Scripting copy files from one dir to another Post 302107824 by mohan705 on Wednesday 21st of February 2007 04:33:58 AM
Old 02-21-2007
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 [ ! -d ${tgt_path}];
then
mkdir -p ${tgt_path}
#mkdir -p abc/xyz
fi
cp ${src_path}/aaa* ${tgt_path}/

Thanks
MR
 

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

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

3. Shell Programming and Scripting

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. (3 Replies)
Discussion started by: snag49ers
3 Replies

4. 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

5. 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

6. Shell Programming and Scripting

Any command to delete files from source dir after SFTP copy

Hi, I am currently using SFTP 'put' command to copy all files to remote server and then delete the copied files from source directory. Can anyone help me with a single command to copy and remove files in one go? Thanks and Regards, Chetan Vyas (5 Replies)
Discussion started by: chetancrsp18
5 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

files copy to dir

Hi, I have a directory which is having many files. I want to copy 10files at a time to another directory. For example. First 10 files to one directory, then next 10 files to another directory and so on. Please let me know if any work around there for it. Thanks (4 Replies)
Discussion started by: Anjan1
4 Replies

9. Shell Programming and Scripting

Copy files to a dir using from a list

Hi all, I'd very grateful for some help with the following: I have a directory with several subdirectories with files in them. All files are named different, even between different subdirectories. I also have a list with some of those file names in a txt file (without the path, just the file... (5 Replies)
Discussion started by: foracoffee
5 Replies

10. Shell Programming and Scripting

how to copy current date files to another dir

i have directory /abcd and i want to copy all today date files in /xyz directory. i am able to see the files by using below command but not able to understand copy. find . -mtime -1 -type f -exec ls -l {} \; (2 Replies)
Discussion started by: learnbash
2 Replies
update-fonts-dir(8)					      System Manager's Manual					       update-fonts-dir(8)

NAME
       update-fonts-dir - compile fonts.dir files

SYNOPSIS
       update-fonts-dir [OPTION] directory ...

DESCRIPTION
       update-fonts-dir creates a fonts.dir file in an X font directory by invoking mkfontdir(1x) with the appropriate arguments.  It is typically
       invoked only from the post-installation and post-removal scripts of a package containing fonts for the X Window System, but may be  invoked
       at  any	time  to  reconstruct  fonts.dir  files.   For	each directory, which is simply the last component of its path (such as '75dpi' or
       'misc'), update-fonts-dir will generate either /usr/lib/X11/fonts/directory/fonts.dir or /usr/share/fonts/X11/directory/fonts.dir from  the
       fonts.scale and font files found within it.

       This  enables  multiple packages to provide names for fonts in the same directory.  No font package actually provides the fonts.dir file in
       the X font directory itself, so there is no danger of overwriting one package's font names with those of another.

       For instance, the two packages  'xfonts-base'  (real)  and  'xfonts-nifty'  (hypothetical)  may	both  install  fonts  into  the  directory
       /usr/lib/X11/fonts/misc,  and  update-fonts-dir	will  ensure that the fonts.dir file in that directory contains information about the font
       files provided by both packages.

       The format of fonts.dir files is described in the mkfontdir(1x) manual page.

       An example of how to use update-fonts-dir in package maintainer scripts is provided in the Debian Policy Manual.

OPTIONS
       -h, --help displays a brief usage message and exits.

       -7, --x11r7-layout switches the font layout to the one introduced in X11R7: fonts in /usr/share/fonts/X11/directory (default is:  fonts	in
       /usr/lib/X11/fonts/directory)

OPERANDS
       update-fonts-dir  takes	one or more X font directory names to operate on as operands.  Only the final path component of the directory name
       should be specified; e.g.,
	      update-fonts-dir 75dpi
       is correct, while 'update-fonts-dir /usr/X11R6/lib/X11/fonts/75dpi' and 'update-fonts-dir /usr/lib/X11/fonts/75dpi' are not.

ENVIRONMENT
       COLUMNS
	      indicates the width of the terminal device in character cells.  This value is used for formatting diagnostic messages.  If not  set,
	      the terminal is queried using stty(1) to determine its width.  If that fails, a value of '80' is assumed.

DIAGNOSTICS
   Errors
       usage error: one or more font directories must be provided
	      update-fonts-dir was invoked without operands.  Supply one or more X font directory names to operate on.

       usage error: unrecognized option
	      update-fonts-dir was invoked with an unrecognized option argument.  Use only the options documented in "OPTIONS", above.

       fatal error: path to X font directory must be used
	      A directory name was supplied that was not an X font directory name.  Supply X font directory names only.

   Warnings
       warning: absolute path directory was provided
	      Usage of absolute paths is deprecated.  Use only the final component of the X font directory name for directory.

       warning: directory does not exist or is not a directory
	      The supplied directory was invalid.  update-fonts-dir skipped it.

EXIT STATUS
       0      update-fonts-dir ran successfully.

       1      update-fonts-dir experienced a fatal error; see the section on diagnostic messages above.

       2      update-fonts-dir was invoked with invalid arguments.

BUGS
       See  the  Debian  Bug  Tracking	System <http://bugs.debian.org/xfonts-utils>.  If you wish to report a bug in update-fonts-dir, please see
       /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.

AUTHOR
       update-fonts-dir was written by Branden Robinson.

SEE ALSO
       mkfontdir(1x)

Debian Project							    2004-11-11						       update-fonts-dir(8)
All times are GMT -4. The time now is 05:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy