Re: if question

From: Charles Heizer (cheizer_at_sbcglobal.net)
Date: 02/23/04


Date: Mon, 23 Feb 2004 19:07:19 GMT

Hello,
Thanks for all of the suggestions, but none of them worked.

I tried the suggestions outside of my script and they work fine, I think
  the real problem has to do with the command line application I'm calling .

Thanks for everyone's help.

- Charles

Bryan Oakley wrote:

> Charles Heizer wrote:
>
>> hello,
>> how can I put a if statement on one line?
>>
>> example --
>> if {$noprompt == "-noprompt"} {$noprompt}
>
>
> Taking the question literally, the answer is almost identical to your
> example:
>
> if {$noprompt == "-noprompt"} {do whatever you want}
>
> If what you're really after is in the spirit of your example you
> probably want something like this:
>
> expr {$noprompt == "-noprompt" ? $noprompt : ""}
>
> In and of itself that's pretty useless since the returned value is
> thrown away. Perhaps you mean this:
>
> set noprompt [expr {$noprompt == "-nooprompt" ? $noprompt : ""}]
>
> Though, if that is the goal, why not this:
>
> if {$noprompt != "-noprompt"} {set noprompt ""}
>
>
> Do any of the above meet your needs? What exactly are you trying to
> accomplish?
>



Relevant Pages

  • Re: Frameborder in CSS?
    ... And surely you could have given a _real_ example if you have a real problem. ... What inline HTML stuffs? ... people seem to think that replacing presentational HTML attributes by CSS code is some sort of game - without realizing that there is no prize. ... It is generally worse than useless to modify existing pages to clean them up that way. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: using sed to replace everything between quotes
    ... Based on the user's input to that script, ... some useless text goes here goodexpression="$NEWLISTOFIPADDRESSES" some ... matching the file's syntax, ... and will be less likely to break than some obscure sed expressions ...
    (comp.unix.shell)
  • Script dbspace-pages.sh posted to IIUG library; part of monitor_space
    ... an underscore instead of the dash). ... I recently ran the script against an OnLine 7 server where the ... pretty but somewhat useless. ... take to get posted by the webmaster but it should have an upload date ...
    (comp.databases.informix)
  • Re: Frontpage protection for jpg images?
    ... This code is useless. ... Murray ... > Try This, it disables Right Click ... > // Use the script, ...
    (microsoft.public.frontpage.addins)
  • Re: Updated Javascript Best Practices document
    ... understand its application to the practical programming and - attention ... If script is enabled, then your job is not to show some signs to your ... I may think only of something the most generic and rather useless like ...
    (comp.lang.javascript)