Re: questions about colon ":" command

From: Janis Papanagnou (Janis_Papanagnou_at_hotmail.com)
Date: 04/04/05


Date: Mon, 04 Apr 2005 00:20:31 +0200

Chris F.A. Johnson wrote:
>
>>>Janis Papanagnou <Janis_Papanagnou@hotmail.com> said:
>>>>
>>>>if command
>>>>then :
>>>>else anothercommand
>>>>fi
>
> It is rarely needed in this context. There are ways to avoid it,
> e.g.:

True. You can work around that pattern in a couple of ways.

Though (if I had '!' not available) I'd prefer the above for clarity
and better legibility (and things get worse, IMO, as the conditions
get more complex).

> command || {
> ## commands here
> }
>
> ##############
>
> command
> if [ "$?" -ne 0 ]
> then
> ## commands here
> fi

Janis



Relevant Pages

  • Re: OSX on Intel Could Destroy Microsoft
    ... >> to web apps, it's worth remember that an app that works in just Firefox ... > environments than a web app that requires Safari or Firefox. ... I think commands are more discoverable when they're ... >> desktop app, if a command is grayed out, what context do you have to be ...
    (comp.sys.mac.advocacy)
  • Re: Problem with services
    ... Whenever any process is run on windows it is run within a Context. ... You must change the working directory to the directory of where your ... Windows and the preferred method is to use net commands. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Button list control
    ... acting in the context of a program framework. ... Controls are the basis of a user interface. ... >> available commands. ... The File menu is renamed Transaction and contains a submenu Action ...
    (comp.lang.pascal.delphi.misc)
  • Re: Common Procedure
    ... A common procedure is great idea. ... Further, I would avoid using "domenuItem", as that suggests a particular ... You standard code module can thus be: ... try and stay away from those old style menu commands. ...
    (microsoft.public.access.formscoding)
  • Re: ExtEscape in spooler context ???
    ... I think you want to send some commands based on information available in the ... > Application context in the DocumentEvent_STARTDOCPOST and I was able to ... > render(in spooler context) comes after the Job Setup commands in the ...
    (microsoft.public.win32.programmer.gdi)