[opensuse] BASH - I give up : (



Listmates,

Stuck on a stupid bash problem again. Why can't I set a variable within a set
of parenthesis?

#!/bin/bash

# This works

[[ $1 == "--verbose" || $1 == "-v" ]] && verbose='y'

[[ $1 == "--verbose" || $1 == "-v" ]] && ( echo "this"; echo "that" )

# This _doesn't_ work

[[ $1 == "--verbose" || $1 == "-v" ]] && ( verbose='y'; echo "that" )


No matter what I do, if I try to set a variable inside the ( ) expression, it
never gets set -- Why?



--
David C. Rankin, J.D.,P.E. |
Rankin Law Firm, PLLC | Countdown for openSuSE 11.1
510 Ochiltree Street | http://counter.opensuse.org/11.1/small
Nacogdoches, Texas 75961 |
Telephone: (936) 715-9333 | openSoftware und SystemEntwicklung
Facsimile: (936) 715-9339 | http://www.opensuse.org/
www.rankinlawfirm.com |
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: [opensuse] BASH - I give up : (
    ... Jim Cunning wrote: ... Stuck on a stupid bash problem again. ... set of parenthesis? ...
    (SuSE)
  • Re: [opensuse] BASH - I give up : (
    ... On Friday 14 November 2008 20:54:16 David C. Rankin wrote: ... Stuck on a stupid bash problem again. ...
    (SuSE)
  • Re: displaying text & variable information in cell
    ... Nope, sorry Rick. ... parenthesis around the variables as well, but similar to above, NG. ... I'm stuck on my macro now on some execution error 13, ... does this modified statement work also? ...
    (microsoft.public.excel.misc)
  • Re: echoing to seperate file problem
    ... it gets stuck on the parenthesis saying it is unexpected and ... > stops there and won't create the other file. ... > this so I can echo the entire line including parenthesis to the file? ...
    (comp.unix.questions)