Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!spool.mu.edu!uunet!munnari.oz.au!brolga!lingua.cltr.uq.OZ.AU!root From: root@lingua.cltr.uq.OZ.AU (Hulk Hogan) Newsgroups: comp.unix.shell Subject: Shell quoting problem. Passing a "?" parameter. Summary: Need quoting help Keywords: sh, quoting Message-ID: <1991May10.062827.19863@lingua.cltr.uq.OZ.AU> Date: 10 May 91 06:28:27 GMT Distribution: comp Organization: Centre for Language Teaching and Research, Uni of Queensland, AUSTRALIA. Lines: 53 Hi, I have a fun menu-based shell for my naive users written in shell script. I have a problem, in that I have to send in a ? character to a routine, but am having problems. Some background. I have a function "do_menu" displays a menu, gets a choice and then runs that choice. It takes the items on the menu, and the programs to run as arguments. Some of these programs have arguments, so that I use double quotes to keep them together. One of these commands sends in a "?" character as the argument. (It is called by other menu selections with other characters as argument.) An equivalent function to demonstrate my problem would be % sh $ dm() { $* } To demonstrate, I use the simple example of dm "echo ?", which just runs "echo ?". However, I want to get a ? character printed out. Not the results of explanding the meta-character ?, or the string '?' or \? or whatever. Just the single character ?. Any ideas? Here's what I've tried. $ ls ? 1 4 $ dm "echo ?" 1 4 $ dm 'echo ?' 1 4 $ dm "echo \?" \? $ dm 'echo \?' \? $ dm "echo '?'" '?' $ dm 'echo "?"' "?" $ If it's any help, I'm on a SPARC running SunOS 4.0.3. Is this yet another fixed-in-4.1 sun bug??? /\ndy -- Andrew M. Jones, Systems Programmer, Internet: andy@lingua.cltr.uq.oz.au Centre for Lang. Teaching & Research, UUCP: uunet!lingua.cltr.uq.oz.au!andy University of Queensland, St. Lucia, Phone: +61 7 365 6915 (Use 07 in Oz) Brisbane, Qld. AUSTRALIA 4072 Fax: +61 7 365 7077 IRC: HulkHogan "No matter what hits the fan, it's never distributed evenly....."