Re: update this morning=347 pkgs from trinity?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 01 August 2018 03:09:19 pm Stefan Krusche wrote:
> Am Mittwoch 01 August 2018 schrieb Michael:
> > and modifying the '/usr/bin/ni' script to:
> >
> > michael@local [~]# cat /usr/bin/no-internet
> > #!/bin/bash
> > COMMAND="$1"
> > shift
> > for arg; do
> > COMMAND="$COMMAND \"$arg\""
> > done
> > sg no-internet "$COMMAND"
>
> Why not just:
>
> sg no-internet "$@"
>
> which would do the same as the code above, AFAIU.

Hi Stefan,

It doesn't do the same, but it's not my code, so...

AFAIR the difference is in how shell does the expansion, where "$@" can break 
single arguments in to garbage because of white spacing and the 
COMMAND="$COMMAND \"$arg\"" re-adds quotes properly to not break single 
arguments that have white space.  (Or less likely it was an sg issue of passed 
in arguments?)

The full explanation is (was) buried on that thread somewhere, or on something 
that thread links(ed) to.  It made sense to do at the time, but I'd need 
someone else with a much better depth of skill with bash/shell/sg to 
authoritatively explain it.

Best,
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-users-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
Read list messages on the web archive: http://trinity-users.pearsoncomputing.net/
Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting




[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux