The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
absolute path Kirichiko UNIX for Dummies Questions & Answers 2 10-03-2007 03:30 AM
$PWD shows absolute path vs path w/symbolic links kornshellmaven Shell Programming and Scripting 3 06-13-2007 09:15 AM
absolute path filedeliver High Level Programming 4 06-05-2007 02:18 PM
vi - replacing a relative path with absolute path in a file Yinzer955i UNIX for Dummies Questions & Answers 2 09-07-2006 08:47 AM
HOW to make absolute path???? HELP youngvet High Level Programming 1 11-01-2003 01:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #15  
Old 05-15-2008
Registered User
 

Join Date: Jul 2006
Posts: 189
Era now it will copoy files with spaces also

Code:
#! /usr/bin/ksh

cd /home/backup/
find /home/abc/ -name "*.s" | while read line
do
  p=$(dirname "$line" )
  p1=$(echo $p | sed 's/\///')
  mkdir -p $p1
  cd $p1
  tocopy=$(pwd)
  echo $tocopy
  cp "$line" $tocopy
  cd -
done
Reply With Quote
Forum Sponsor
  #16  
Old 05-15-2008
Registered User
 

Join Date: Jan 2008
Posts: 54
find & copy files with absolute path

Thanks you
thanks era & aju_kup
My problem is solved
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
cpio, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0