Re: Newbie-ish question about ( [ and [[



Thanx for the great input. I think I'm beginning to get the light bulb
turned on.

Here's what I believe y'all said.

The construct ( blah ) means:

( # Open a new subshell
Blah # Execute the "Blah" command(s) and save the exit status
) # Close the subshell and return the exit status of Blah to
the calling shell


So, I can actually put any command or command string inside of the "(
)" that returns an exit status that the "if" then evaluates. Operators
are permitted, but only as they relate to the commands.

Next, the construct [ foo ] means:

[ # Execute the alias of the test command on the following
Blah # something that the test command can legally evaluate
] # terminus of what is being tested

So the contents of the "[ ]" must contain operators, not commands;
unless an operator is operating on the result of a command.

Did I get it right?

Thanx!

.



Relevant Pages

  • Re: administrative password, resetting?
    ... mkdir temphack *creates the folder temphack ... Now what you have just done is told the computer to backup the command ... If the Administrator Account is called Frank and you want the password ... "net user Frank blah" ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: administrative password, resetting?
    ... mkdir temphack *creates the folder temphack ... Now what you have just done is told the computer to backup the command ... If the Administrator Account is called Frank and you want the password ... "net user Frank blah" ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: administrative password, resetting?
    ... mkdir temphack *creates the folder temphack ... Now what you have just done is told the computer to backup the command ... If the Administrator Account is called Frank and you want the password ... "net user Frank blah" ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Newbie-ish question about ( [ and [[
    ... The construct (blah) means: ... Blah # Execute the "Blah" commandand save the exit status ... I can actually put any command or command string inside of the "( ...
    (comp.unix.shell)
  • setting an alias in .cshrc with parentheses in it ...
    ... I often run this command: ... includes parentheses. ... So, to save time, I added this line to my .cshrc: ... MSIE blah blah)" ...
    (freebsd-questions)