Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!ucsd!ucbvax!hplabs!hpda!hpsemc!gph From: gph@hpsemc.HP.COM (Paul Houtz ) Newsgroups: comp.unix.questions Subject: Overriding Parameter Expansion? Message-ID: <810026@hpsemc.HP.COM> Date: 23 Aug 88 15:05:54 GMT Organization: The Technology Access Center Lines: 46 Does any one know if it is possible for a program or function to tell whether the shell (especially csh or ksh) has expanded a parameter into multiple file names? I know that the it is designed to do this, but I need to eliminate the possibility. For example: myfunc () { echo $1 echo $2 echo $3 } If I type in myfunc file1 file2 file3, then the results are file1 file2 file3 If I type in myfunc * file2 file3 then the results are first_file_in_directory second_file_in_directory third_file_in_directory It would be nice if I could at least know that expansion has occurred in parameter 1. Note, I do NOT want to turn off parameter expansion (set -f) in my shell. I also do NOT want to quote the parameters, e.g., I do not want to say myfunc "*" file2 file3. Finally, something to consider: Since there are commands that will do the filename expansion for you, doesn't it seem contrary to the basic idea of UNIX that this expansion is done for you automatically by the shell? Normally unix does not get in my way, but in this example it does. I wouldn't mind if I had to expand my parameters myself. I think I should be able to invoke a function and have access to the raw parameters with a shell script. (and more than 9, too.) Oh well.