On Tue, 2011-05-24 at 09:41 +0300, Alkis Georgopoulos wrote:
> Στις 23-05-2011, ημέρα Δευ, και ώρα 12:17 -1000, ο/η Warren Togami Jr.
> έγραψε:
> > http://hg.fedorahosted.org/hg/virt-manager/rev/1f781890ea4a
> > This is a very similar issue.  Notice their kludge to detect nc's 
> > capabilities.
> 
> I'd use something like this instead, in some initialization code like
> e.g. ltsp-common-functions:
> 
> if LANG=C nc -q 2>&1 | grep -q "option requires an argument"; then
>     nc_q_param="-q -1"
> fi
> 
> And then replace the existing "-q-1" with $nc_q_param (unquoted) in all
> the nc calls.
> 
> 
> Relevant bug report from Debian:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502188
> 
> 
> Output of the nc* tools available in Ubuntu Lucid:
> 
> alkisg@alkis:~$ nc.traditional -q
> nc.traditional: option requires an argument -- 'q'
> nc -h for help
> 
> alkisg@alkis:~$ nc.openbsd -q
> nc.openbsd: option requires an argument -- 'q'
> usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p
> source_port]
>         [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]
>         [-x proxy_address[:port]] [hostname] [port[s]]


Output of nc -q on Fedora 14:
$ nc -q
nc: invalid option -- 'q'
usage: nc [-46CDdhklnrStUuvz] [-I length] [-i interval] [-O length]
          [-P proxy_username] [-p source_port] [-s source] [-T ToS]
          [-V rtable] [-w timeout] [-X proxy_protocol]
          [-x proxy_address[:port]] [destination] [port]

Output of nc -q on Red Hat 5
$ nc -q
nc: invalid option -- q
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
          [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
          [-x proxy_address[:port]] [hostname] [port[s]]

Perhaps this:

nc_q_param="-q"
nc_output=`LANG=C nc -q 2>&1`
( echo $nc_output |grep -q "option requires an argument" ) \
     && nc_q_param="-q -1"
( echo $nc_output |grep -q "invalid option -- q " ) \
     && nc_q_param=" "
( echo $nc_output |grep -q "invalid option -- 'q' " ) \
     && nc_q_param=" "
unset nc_output

-David



------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to