From: Charles H. <he...@ll...> - 2003-11-17 20:57:38
|
Ok, I got a fix to my issue. It's more of a band aid but it works. I changed my switch statement to -- "-p" { puts -nonewline "Please enter the password: " flush stdout set gPass [gets stdin] } Now, I'm relying on tclsh and not the shell. Thanks for all of the help! - Charles On Nov 17, 2003, at 12:45 PM, Jim Ingham wrote: > Humm... It even seems to be by design (from man tcsh): > > Furthermore, all Substitutions (see below) except History > substitution > can be prevented by enclosing the strings (or parts of > strings) in > which they appear with single quotes or by quoting the crucial > charac- > ter(s) (e.g., `$' or ``' for Variable substitution or Command > substitu- > tion respectively) with `\'. > > That seems really inconvenient, but presumably there is some good > reason for it... > > Jim > > > On Nov 17, 2003, at 12:18 PM, Charles Heizer wrote: > >> Hi Jim, >> Thanks for the suggestion, unfortunately it did not work. I found >> that Robert's suggestion to escape the ! did work. >> >> Thanks for your help, >> >> - Charles >> >> On Nov 17, 2003, at 12:02 PM, Jim Ingham wrote: >> >>> That's not a Tcl error, it is coming from your command shell when >>> you go to run the Tcl script. ! is telling the shell to substitute >>> the event after the ! onto the command line. If you were doing: >>> >>> $ myScript -p Im!Null >>> >>> you really want to do: >>> >>> $ myScript -p 'Im!Null' >>> >>> Jim >>> >>> On Nov 17, 2003, at 11:56 AM, Charles Heizer wrote: >>> >>>> 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 >>>>> >>>>> >>>> >>>> >>> -- >>> Jim Ingham ji...@ap... >>> Developer Tools >>> Apple Computer >>> >>> >> >> > -- > Jim Ingham ji...@ap... > Developer Tools > Apple Computer > > |