![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Recursion to Copy a Directory structure | avrkiran | Shell Programming and Scripting | 2 | 03-31-2008 02:43 AM |
| Copying with directory structure | Cnfsed | UNIX for Dummies Questions & Answers | 4 | 11-29-2007 12:51 AM |
| Need help in Directory Structure | murtaza | Shell Programming and Scripting | 5 | 03-29-2007 11:14 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 |
| Copying a Directory Structure to a new structure | jhansrod | UNIX for Dummies Questions & Answers | 8 | 07-27-2005 06:24 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
redirection and copying with same directory structure
Dear Experts,
How can I solve this problem ? I want to redirect with having the same directory structure as in my input. Code:
for temp in `find ./CSV/ -name "*.v"`
do
fname = `basename $temp`
./script.sh $temp > ./out/$fname
done
I want to preserve the directory structure when redirecting to out directory here. Ex- Input file is inside ./CSV/GSM/ad0_conv.v then after running the above script it should be ./out/CSV/GSM/ad0_conv.v Pls help... |
|
||||
|
Quote:
I did something like below: Code:
for temp in `find ./CSV/ -name "*.v"`
do
mkdir -p out/`dirname $temp`
./transform.sh $temp > ./out/$temp
done
Code:
INDIR=./CSV
OUTDIR=./out
#copy only directories with "*cpp" filenames
find $INDIR -type f -name "*.file" -exec dirname {} \; |
sed -e "s/^\($INDIR\)\(.*\)/$OUTDIR\2/g" | xargs mkdir -p
Can I do the same thing what I did in my code with sed and xargs. Thanks in advance.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|