Passing variable with *

Hi Folks,
I would like to pass a variable with a wild card in an argument. My script works if I don't use a wildcard but fails when I use . I want to use the script like:
scriptname -F <filename
>

@ i = 0
while ($i <= ${#argv})
   switch ($argv[$i])
    case -F:
        set j = `echo $i +1 |bc`
        set file = `echo $argv[$j]`
    endsw
@ i++
end

I want my $file = filename*, that is with wild card.
Thanks in advance.

You can try putting the variable in double-quotes " ", but CSH's quoting functionality is extremely perplexing. See csh programming considered harmful.

I already tried the option of using double/single quotes but it doesn't work.

---------- Post updated at 12:12 PM ---------- Previous update was at 11:39 AM ----------

I had to use BASH which allows you to pass variable with wild card provided if you use double quotes.

Thanks for you help.

1 Like