From: wylbur37 on
If the current directory that I'm sitting on has the files "one.txt",
"two.txt" and "three.txt",
and I run a script called "xyz" by saying ...

xyz *.txt

it'll be the same as if I had said ...

xyz one.txt two.txt three.txt

From within the script, "$0" will return the name of the script
itself,
"$1" will return "one.txt", and "$*" will return "one.txt two.txt
three.txt".

But what I need is the original un-expanded argument(s).
In other words, what I need is the "*.txt" (without the quotes).

How can I get that?

From: Bit Twister on
On Sun, 20 Apr 2008 17:28:37 -0700 (PDT), wylbur37 wrote:
> If the current directory that I'm sitting on has the files "one.txt",
> "two.txt" and "three.txt",
> and I run a script called "xyz" by saying ...
>
> xyz *.txt
>
> But what I need is the original un-expanded argument(s).
> In other words, what I need is the "*.txt" (without the quotes).

xyz '*.txt'

From: Unruh on
wylbur37 <wylbur37nospam(a)yahoo.com> writes:

>If the current directory that I'm sitting on has the files "one.txt",
>"two.txt" and "three.txt",
>and I run a script called "xyz" by saying ...

> xyz *.txt

>it'll be the same as if I had said ...

> xyz one.txt two.txt three.txt

>From within the script, "$0" will return the name of the script
>itself,
>"$1" will return "one.txt", and "$*" will return "one.txt two.txt
>three.txt".

>But what I need is the original un-expanded argument(s).
>In other words, what I need is the "*.txt" (without the quotes).

You cannot. The program never gets that. the shell expands teh arguments
long before the program ever sees the argument.

If you want the program to get the unexpanded argument you need to feed it
to the program in single quotes. And then it is up to the program to expand
teh arguments.





>How can I get that?

From: pk on
On Monday 21 April 2008 02:28, wylbur37 wrote:

> If the current directory that I'm sitting on has the files "one.txt",
> "two.txt" and "three.txt",
> and I run a script called "xyz" by saying ...
>
> xyz *.txt
>
> it'll be the same as if I had said ...
>
> xyz one.txt two.txt three.txt
>
> From within the script, "$0" will return the name of the script
> itself,
> "$1" will return "one.txt", and "$*" will return "one.txt two.txt
> three.txt".
>
> But what I need is the original un-expanded argument(s).
> In other words, what I need is the "*.txt" (without the quotes).
>
> How can I get that?

set -f; xyz *.txt; set +f
From: Robert Newson on
wylbur37 wrote:

> If the current directory that I'm sitting on has the files "one.txt",
> "two.txt" and "three.txt",
> and I run a script called "xyz" by saying ...
>
> xyz *.txt
>
> it'll be the same as if I had said ...
>
> xyz one.txt two.txt three.txt
>
> From within the script, "$0" will return the name of the script
> itself,
> "$1" will return "one.txt", and "$*" will return "one.txt two.txt
> three.txt".
>
> But what I need is the original un-expanded argument(s).
> In other words, what I need is the "*.txt" (without the quotes).
>
> How can I get that?

xyz \*.txt