The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Transfer files wih directory structure. uxlunatick SCO 11 04-28-2008 03:25 PM
Recursion to Copy a Directory structure avrkiran Shell Programming and Scripting 2 03-31-2008 02:43 AM
MV files from one directory structure(multiple level) to other directory structure srmadab UNIX for Advanced & Expert Users 4 09-13-2006 04:01 PM
any idea to copy directory structure myelvis UNIX for Dummies Questions & Answers 6 11-18-2003 05:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-11-2006
adddy adddy is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 3
copy files with directory structure

i have a text file as.


/database/sp/NTR_Update_Imsi_List.sql
/database/sp/NTR_Update_Imsi_Range_List.sql
/database/sp/NTR_Vlr_Upload.sql
/database/tables/StatsTables.sql
/mib/ntr.mib
/mib/ntr.v2.mib
/scripts/operations/ntr/IMSITracer.ph
/scripts/operations/ntr/IMSITracer.pl
/scripts/operations/ntr/NTIMSIRangeUpload.pl
/scripts/operations/ntr/NTRBatchUploadIMSI.pl

i want to copy all this files with their directory structures into home directory
plz help.
  #2 (permalink)  
Old 12-11-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
I found this tip in bash guide

Code:
( cd /dir1/dir2 && tar cf - . ) | ( cd / && tar xpvf - )
  #3 (permalink)  
Old 12-11-2006
adddy adddy is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 3
Unhappy

name of my file is aadd.sh.
i useur command as

mkdir -p $1/$2
cat aadd.sh|( cd $1/$2 && tar cf - . ) | ( cd / && tar xpvf - )

were $1=ntt
n $2=rss

but its not working
  #4 (permalink)  
Old 12-11-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
I didn't read your requirement properly.

Code:
while read pth
do
    dr=`dirname $pth`
    if [ -d "homedir/$dr" ]
    then
       mkdir -p "homedir/$dr"
    fi
    cp $pth "homedir/$dr"
done < aadd.sh
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0