From: Charles H. <he...@ll...> - 2003-11-17 20:16:51
|
Hi Robert, Ok, I tried to escape the "!" ands that works. Thanks! Now, is there someway I could escape this and any other characters that might cause this in my switch statement so users of the script would not need to know this? Thanks, - Charles On Nov 17, 2003, at 12:00 PM, Robert Minichino wrote: > That's the shell complaining about the "!" in the command line. Try > escaping the exclamation with a backslash like "Im\!Null" > > -- > Robert Minichino > >> -----Original Message----- >> From: LLNL Charles Heizer >> Sent: Monday, November 17, 2003 2:56 PM >> To: Jim Ingham >> Cc: Tc...@li... >> Subject: Re: [MACTCL] Set value via switch command is not working >> >> >> Sure, >> Here is one I tried. >> >> Im!Null >> >> And the error looks like this -- >> >> tcsh: Null: Event not found. >> >> Thanks, >> >> - Charles >> >> On Nov 17, 2003, at 11:53 AM, Jim Ingham wrote: >> >>> Can you give us an example of the bad input that will cause >> this to >>> fall over. >>> >>> Jim >>> >>> On Nov 17, 2003, at 11:09 AM, Charles Heizer wrote: >>> >>>> Hello, >>>> I was not sure how to start this so here it goes. I have a script >>>> that seems to work fine except for one thing. I have a >> switch that >>>> sets a value and its a password. I have found that some passwords >>>> cause the script to barf. One such password contains the >> work "Null". >>>> Can some one please tell me how or if I can get this to work? >>>> >>>> Thanks, >>>> >>>> - Charles >>>> >>>> HERE is my Syntax -- >>>> >>>> if {$nArgs == 0} { >>>> puts "ERROR: no args used. Try using --help for usage >> info.";exit >>>> } else { >>>> foreach {arg val} $argv { >>>> switch -- $arg { >>>> "-h" {set theFile $val} >>>> "-s" {set theHost $val} >>>> "-t" {set theURL $val} >>>> "-u" {set gUser $val} >>>> "-p" {set gPass $val} >>>> "-l" {set gLog $val} >>>> "--help" { >>>> puts "-h = Host >> File (e.g. mysystem.llnl.gov theUser >>>> thePassword)" >>>> puts "-s = A >> Single Host" >>>> puts "-t = The >> Download URL" >>>> puts "-u = >> Global User Name" >>>> puts "-p = >> Global Password" >>>> exit >>>> } >>>> "default" {puts "ERROR: unknown >> command. Try using --help for >>>> usage info.";exit} >>>> } >>>> } >>>> } >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF. Net email is sponsored by: GoToMyPC >>>> GoToMyPC is the fast, easy and secure way to access your >> computer from >>>> any Web browser or wireless device. Click here to Try it Free! >>>> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/ >>>> g22lp.tmpl >>>> _______________________________________________ >>>> Tcl-mac mailing list >>>> Tc...@li... >>>> https://lists.sourceforge.net/lists/listinfo/tcl-mac >>>> >>> -- >>> Jim Ingham ji...@ap... >>> Developer Tools >>> Apple Computer >>> >>> >> >> >> >> ------------------------------------------------------- >> This SF. Net email is sponsored by: GoToMyPC >> GoToMyPC is the fast, easy and secure way to access your computer from >> any Web browser or wireless device. Click here to Try it Free! >> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/ > g22lp.tmpl > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > |