On Wed, Apr 21, 2010 at 03:45:24PM -0000, Marc Tardif wrote:
> However, this will not work with dash, so the compromise is either to
> use eval which works almost everywhere or arrays which works on real
> shells.

...or just skip the part of that code that assigns the command to a
variable and tries to execute whatever's in the variable?


So, instead of:

  nc -q 2>&1 | grep -q 'requires an argument'
  if [ $? -eq 0 ]
  then
      CMD='nc -q 0 127.0.0.1 5905'
  else
      CMD='nc 127.0.0.1 5905'
  fi
  $CMD

We'd do:

  nc -q 2>&1 | grep -q 'requires an argument'
  if [ $? -eq 0 ]
  then
      nc -q 0 127.0.0.1 5905
  else
      nc 127.0.0.1 5905
  fi

How does that sound?

-- 
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/

-- 
Virt-manager unable to display guest consoles when connecting to a host user 
who is using the zsh shell
https://bugs.launchpad.net/bugs/556113
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to