Sponsored Content
Full Discussion: cp not coping properly
Top Forums Shell Programming and Scripting cp not coping properly Post 302259815 by vbe on Wednesday 19th of November 2008 04:15:18 AM
Old 11-19-2008
Well the sort of issue you may get with cp is when it sees a link, and copies it ...as a directory with all its content etc...

Why not use cpio? or test if dir is a true dir or a symlink...

why cpio? It will copy depending of your options the links as links... (but there are also other commands to choose from)
how?
source= /tmp/source
dest=/tmp/dest

In HPUX...
Code:
cd $source;
find . -print|cpio -pduml $dest

This is just one solution, Im sure there are plenty of valid ways to do the same...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

coping all files from a directory

Hello, i have a directory;say /home/pavi i has some files and every day files keep adding to it. i am writing a shell script which copies all the files from this directory to another.say /home/tom/tmp how do i copy all the files from /home/pavi to /home/tom/tmp all the files in the... (1 Reply)
Discussion started by: pavan_test
1 Replies

2. Shell Programming and Scripting

For loop - coping with an asterisk item

How do you get a for loop to cope with one of the items being an asterisk? for myResult in `echo "*"` do echo "$myResult" done The asterisk is returning a file listing in the PWD. The same result can be got from: for myResult in "*" do echo "$myResult" done (1 Reply)
Discussion started by: PaulUrwin
1 Replies

3. Shell Programming and Scripting

Coping files from server to local

This is my first post, so first I'd like to say hello to everyone. Here's the issue I'm having...I run a macro against multiple log files every morning. The procedure is sort of time consuming. I have to log into the box where there are stored, then ftp/download them to my local drive using... (3 Replies)
Discussion started by: jhofilena
3 Replies

4. UNIX for Dummies Questions & Answers

coping directories?

Is this possible? If so could i have the command for it thanks!! (2 Replies)
Discussion started by: JamieMurry
2 Replies

5. UNIX for Advanced & Expert Users

mail is not sent, instead just coping into /var/spool/queue dir

Hi, I have some problems w/ the sendmail. I see that messages are queued in the /var/spool/mqueue and they are never sent to the recipients. This problem just suddenly started without any modifications in the current configuration. I already started and stop the sendmail and it did not help.... (3 Replies)
Discussion started by: ktanya
3 Replies

6. UNIX for Dummies Questions & Answers

Coping Files for a specific date range

Hi, we have file name appended by date in yymmdd format .. ex: abc090101.dat I need to copy all the files between abc090101 to abc090331.. could you plz help me.. Thanks. (1 Reply)
Discussion started by: kolariya4u
1 Replies

7. UNIX for Dummies Questions & Answers

coping files from unix to windows

hey all, i have a unix computer and a windows os computer connected in the same local network i want to copy the etc folder to the windows computer so if my unix computer's hard disk rashes i can restore it from my windows computer. my first problem is i'm kinda lame with unix...i know... (3 Replies)
Discussion started by: shwinky
3 Replies

8. Shell Programming and Scripting

Progress bar while coping a file needed.

Hi guys I want to create a script which will show the amount of data that is been copied from one location to another location. For example: Say i have a file called abc.img which is approximately 4 gb of size therfore everytime i copy the file from one location to another i want a progress bar... (3 Replies)
Discussion started by: pinga123
3 Replies

9. Shell Programming and Scripting

Problems coping a file in a shl script

I have the following in a shl script: SCRIPT_PATH="/u01/app/banner/test/skid/plus/"; FILE_PATH="/nfs/mercury/u03/banner/test/skid/log"; LIST_FILE_PATH="/u01/banjobs/TEST"; SCRIPT_NAME="szpcal1.sql"; FILE_NAME='new_applicant_list'; I want to copy the file FILE_NAME to LIST_FILE_PATH ... (10 Replies)
Discussion started by: rechever
10 Replies

10. Shell Programming and Scripting

Coping files that containing 2010

I want to use the find command to copy files that contain 2012 from one directory to another. I tried find /Volumes/movies1 -name "*.2012.*" -exec cp -nRv "{}" /Volumes/pdrive/ \; (2 Replies)
Discussion started by: codecaine
2 Replies
copymsg(9F)						   Kernel Functions for Drivers 					       copymsg(9F)

NAME
copymsg - copy a message SYNOPSIS
#include <sys/stream.h> mblk_t *copymsg(mblk_t *mp); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
mp Pointer to the message to be copied. DESCRIPTION
copymsg() forms a new message by allocating new message blocks, and copying the contents of the message referred to by mp (using the copyb(9F) function). It returns a pointer to the new message. RETURN VALUES
If the copy is successful, copymsg() returns a pointer to the new message. Otherwise, it returns a NULL pointer. CONTEXT
copymsg() can be called from user or interrupt context. EXAMPLES
Example 1: : Using copymsg The routine lctouc() converts all the lowercase ASCII characters in the message to uppercase. If the reference count is greater than one (line 8), then the message is shared, and must be copied before changing the contents of the data buffer. If the call to the copymsg() function fails (line 9), return NULL (line 10), otherwise, free the original message (line 11). If the reference count was equal to 1, the message can be modified. For each character (line 16) in each message block (line 15), if it is a lowercase letter, convert it to an upper- case letter (line 18). A pointer to the converted message is returned (line 21). 1 mblk_t *lctouc(mp) 2 mblk_t *mp; 3 { 4 mblk_t *cmp; 5 mblk_t *tmp; 6 unsigned char *cp; 7 8 if (mp->b_datap->db_ref > 1) { 9 if ((cmp = copymsg(mp)) == NULL) 10 return (NULL); 11 freemsg(mp); 12 } else { 13 cmp = mp; 14 } 15 for (tmp = cmp; tmp; tmp = tmp->b_cont) { 16 for (cp = tmp->b_rptr; cp < tmp->b_wptr; cp++) { 17 if ((*cp <= 'z') && (*cp >= 'a')) 18 *cp -= 0x20; 19 } 20 } 21 return(cmp); 22 } SEE ALSO
allocb(9F), copyb(9F), msgb(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 27 Jun 1995 copymsg(9F)
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy