Re: copy a directory recursively without data/files
From: Michael Tosch (eedmit_at_NO.eed.SPAM.ericsson.PLS.se)
Date: 07/29/04
- Next message: Dana French: "Re: strict grep when patterns are presented on standard input"
- Previous message: Stephane CHAZELAS: "Re: Removing single quote from filenames (recursively)"
- In reply to: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Next in thread: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Reply: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Jul 2004 14:00:50 GMT
In article <slrncghi5o.1rg.stephane.chazelas@spam.is.invalid>, Stephane CHAZELAS <this.address@is.invalid> writes:
...
>
> > Question: while perfectly captured by the two '{}',
> > why is the first '{}' in Solaris $0 and not $1?
>
> Why not? It's what POSIX requires, and what most shells do.
>
I see that
#!/bin/sh
echo $0 $1
returns its invocation name and the first argument,
while
sh -c 'echo $0 $1' arg1 arg2
returns arg1 arg2.
So if this is always the case, one could rewrite
find . -type d -exec env d="$dest_root" sh -c '
exec mkdir -p -- "$d/$1"' '{}' '{}' \;
always as
find . -type d -exec env d="$dest_root" sh -c '
exec mkdir -p -- "$d/$0"' '{}' \;
-- Michael Tosch IT Specialist HP Managed Services Technology Solutions Group Hewlett-Packard GmbH Phone: +49 2407 575 313 Mail: michael.tosch:hp.com
- Next message: Dana French: "Re: strict grep when patterns are presented on standard input"
- Previous message: Stephane CHAZELAS: "Re: Removing single quote from filenames (recursively)"
- In reply to: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Next in thread: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Reply: Stephane CHAZELAS: "Re: copy a directory recursively without data/files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|