Greg Wooledge wrote:
On Tue, Aug 16, 2011 at 03:41:19PM -0700, Linda Walsh wrote:
> Ken Irving wrote:
>> Maybe this? today_snaps=( ${snap_prefix} )
> but as you mention, that will put them into an arraysorry
> "imprecise terminology" list for me is some number of objects
> in a s
> On Thu, Aug 18, 2011 at 02:42:03PM -0400, Chet Ramey wrote:
> > The expansions are the default set as described in the quoted paragraph,
> > without pathname expansion and, since the result is passed to the command
> > as a single string, word splitting.
> >
> > I think the confusion arises over
On Thu, Aug 18, 2011 at 02:42:03PM -0400, Chet Ramey wrote:
> The expansions are the default set as described in the quoted paragraph,
> without pathname expansion and, since the result is passed to the command
> as a single string, word splitting.
>
> I think the confusion arises over the precise
On 8/18/11 11:58 AM, Greg Wooledge wrote:
> It would appear "declare -g" does NOT allow you to "jump over" a local
> variable that is shadowing a global. That's disappointing.
That is not its intent. The very narrow purpose of declare -g is to
allow you to declare a variable with attributes in
On 8/18/11 12:14 PM, Greg Wooledge wrote:
> On Thu, Aug 18, 2011 at 10:55:11AM -0400, Chet Ramey wrote:
>> The quoted paragraph applies to all redirection operators (and parameter
>> and variable expansion are still identical). The description of <<<
>> notes that it does not perform pathname expa
On 08/18/2011 08:53 AM, Roman Rakus wrote:
On 08/18/2011 04:38 PM, Sam Steingold wrote:
how do I write a function that would print the same as
$ \ls | cat
f3(){ printf "%s\n" "$@"; }
"\n" looks funny in shell; even though POSIX requires that "\n" does not
treat the \ as an escape but as a li
On 08/18/2011 11:38 AM, Stefano Lattarini wrote:
Hi Eric.
On Thursday 18 August 2011, Eric Blake wrote:
On 08/18/2011 08:44 AM, Eric Blake wrote:
how do I write a function that would print the same as
$ \ls | cat
Useless use of cat. This can be done with \ls -1.
f(){ for a in "$@"; do ech
On Thursday 18 August 2011, Stefano Lattarini wrote:
> Hi Eric.
>
> On Thursday 18 August 2011, Eric Blake wrote:
> > On 08/18/2011 08:44 AM, Eric Blake wrote:
> > >> how do I write a function that would print the same as
> > >> $ \ls | cat
> >
> > Useless use of cat. This can be done with \ls -
Hi Eric.
On Thursday 18 August 2011, Eric Blake wrote:
> On 08/18/2011 08:44 AM, Eric Blake wrote:
> >> how do I write a function that would print the same as
> >> $ \ls | cat
>
> Useless use of cat. This can be done with \ls -1.
>
> > f(){ for a in "$@"; do echo "$a"; done; }
>
> Or skip the
On Thu, Aug 18, 2011 at 10:13:45AM -0700, Linda Walsh wrote:
>Um...the description from "<<<", above indicates it is...subject
> to pathname expansion...If I had matching filesin my dir, it
> expanded and returned them,
> so I'm pretty sure it does PN expansion.
As noted, you're being fooled
` Greg Wooledge wrote:
Now that one is suprising, as it's supposed to take the output of
the ... hmmm.yup!... that's exactly what it does.
takes the work and executes it and returns the results on stdin as
a single quoted blob of output:
> read a <<< *.txt
> echo $a
apc_c
` Chet Ramey wrote:
On 8/18/11 9:37 AM, Greg Wooledge wrote:
The word following the redirection operator in the following descrip-
tions, unless otherwise noted, is subjected to brace expansion, tilde
expansion, parameter expansion, command substitution, arithmetic expan???
` Greg Wooledge wrote:
On Thu, Aug 18, 2011 at 08:03:41AM -0700, Linda Walsh wrote:
4.2 introduce a new -g to declare a global variable inside a function.
Which doesn't say what it would do in situations like the above.
Then let's test:
imadev:~$ echo $BASH_VERSION
On Thu, Aug 18, 2011 at 12:35:37PM -0400, Steven W. Orr wrote:
> lrwxrwxrwx. 1 sorr fc5 Aug 18 08:48 err -> errio
> -rw-rw-r--. 1 sorr fc 3816 Aug 18 08:48 errio
> *836 > [[ -f err ]]
> 837 > echo $? # BAD answer
> 0
Sounds like you want this:
http://mywiki.wooledge.org/BashFAQ/097 -
On Thu, Aug 18, 2011 at 09:26:42AM -0700, Linda Walsh wrote:
> It's like "-e" was very using in bash 3.0-4.0, but you didn't know it so
> thought it worthless.
I certainly knew about -e. It was bad back then, too. It's arguably
worse now, because there are even more variants in implementation th
On 08/18/2011 10:35 AM, Steven W. Orr wrote:
I have a symlink file and if if I test it I get success status with -f.
831 > ls -l errio err
lrwxrwxrwx. 1 sorr fc 5 Aug 18 08:48 err -> errio
-rw-rw-r--. 1 sorr fc 3816 Aug 18 08:48 errio
832 > [[ -f errio ]]
833 > echo $? # Good answer
0
*834 > [[
I have a symlink file and if if I test it I get success status with -f.
831 > ls -l errio err
lrwxrwxrwx. 1 sorr fc5 Aug 18 08:48 err -> errio
-rw-rw-r--. 1 sorr fc 3816 Aug 18 08:48 errio
832 > [[ -f errio ]]
833 > echo $?# Good answer
0
*834 > [[ -h errio ]]
835 > echo $?
Pierre Gaston wrote:
l understood a while ago, now I'll just stop feeding the troll.
---
You obviously feel there needs to be a right and wrong, and
if you haven't made me wrong, you've lost -- indicated by
your resorting to name calling rather than discussing issues.
Sigh.
` Greg Wooledge wrote:
On Thu, Aug 18, 2011 at 06:02:14AM -0700, Linda Walsh wrote:
The "shopt -s expand_aliases" feature has been in bash since I first
encountered it in ~1999.
Fine. You know more bash bad practices than I do. You win.
Just because you didn't know about it do
On Thu, Aug 18, 2011 at 10:55:11AM -0400, Chet Ramey wrote:
> The quoted paragraph applies to all redirection operators (and parameter
> and variable expansion are still identical). The description of <<<
> notes that it does not perform pathname expansion at all.
The word following the red
On Thu, Aug 18, 2011 at 08:03:41AM -0700, Linda Walsh wrote:
> >4.2 introduce a new -g to declare a global variable inside a function.
>
>Which doesn't say what it would do in situations like the above.
Then let's test:
imadev:~$ echo $BASH_VERSION
4.2.10(7)-release
imadev:~$ unset a b;
Pierre Gaston wrote:
Is this a question? or are you trying to make a point?
It is both -- a chance to find answer to a question, or make
the point that aliases in scripts have a useful purposes that
can't be replaced by function clls.
For the question (If I understand correctly):
1) Most
On 8/18/11 9:37 AM, Greg Wooledge wrote:
>>The word following the redirection operator in the following descrip-
>>tions, unless otherwise noted, is subjected to brace expansion, tilde
>>expansion, parameter expansion, command substitution, arithmetic expan???
>>sion, quote rem
On 08/18/2011 04:38 PM, Sam Steingold wrote:
how do I write a function that would print the same as
$ \ls | cat
f3(){ printf "%s\n" "$@"; }
But please move your question like "HOW TO..." somewhere else;
comp.unix.shell usenet group or the #bash IRC channel on freenode or...
This mailing list
On 8/18/11 9:02 AM, Linda Walsh wrote:
>The word following the redirection operator in the following descrip-
>tions, unless otherwise noted, is subjected to brace expansion, tilde
>expansion, parameter expansion, command substitution, arithmetic expan‐
>sion, quote removal, pa
On 08/18/2011 08:44 AM, Eric Blake wrote:
how do I write a function that would print the same as
$ \ls | cat
Useless use of cat. This can be done with \ls -1.
f(){ for a in "$@"; do echo "$a"; done; }
Or skip the loop altogether:
f(){ printf %s\\n "%@"; }
--
Eric Blake ebl...@redhat.co
On 08/18/2011 08:38 AM, Sam Steingold wrote:
mkdir z
cd z
touch a b 'c d'
When doing exercises like this, I like to:
touch a b 'c d'
Notice the double spacing - it proves whether I used enough quoting
throughout the exercise - if 'c d' with one space shows up anywhere,
then I missed quotin
> * Eric Blake [2011-08-15 16:59:29 -0600]:
>
> On 08/15/2011 04:40 PM, Sam Steingold wrote:
>>> * Andreas Schwab [2011-08-15 22:04:04 +0200]:
>>>
>>> Sam Steingold writes:
>>>
Cool. Now, what does this imply?
>>>
>>> "For almost every purpose, shell functions are preferred over aliase
On Thu, Aug 18, 2011 at 5:13 PM, Linda Walsh wrote:
>
>
>
> Pierre Gaston wrote:
>>
>> On Mon, Aug 15, 2011 at 2:31 AM, Linda Walsh wrote:
>>
>>>
>>> Re: BashFAQ/006: http://mywiki.wooledge.org/BashFAQ/006
>>> Pierre Gaston wrote:
>>>
Linda:
>
> please show quote the sect
Pierre Gaston wrote:
On Mon, Aug 15, 2011 at 2:31 AM, Linda Walsh wrote:
Re: BashFAQ/006: http://mywiki.wooledge.org/BashFAQ/006
Pierre Gaston wrote:
Linda:
please show quote the section
that shows using an variable that holds the name of an array to be used (and
assigned
On Thu, Aug 18, 2011 at 06:02:14AM -0700, Linda Walsh wrote:
> The "shopt -s expand_aliases" feature has been in bash since I first
> encountered it in ~1999.
Fine. You know more bash bad practices than I do. You win.
> > b="one two three"
> > read a <<<$b
> > echo $a
> one two three
>The
Greg Wooledge wrote:
[[[ yeah, am running a bit behind]...
On Mon, Aug 15, 2011 at 12:45:58AM -0700, Linda Walsh wrote:
> #!/bin/bash -exu
> +[shopt -s expand_aliases extglob]
>
> alias sub=function
> alias unless='if !'
Aliases don't even *work* in scripts.
Hopefully you someon
On Wed, Aug 17, 2011 at 08:46:34PM -0700, Linda Walsh wrote:
> how do you declare a variable for storage in the context of the caller?
> (using a function)...
> ???
The *caller* declares it.
> I found it very troublesome
> inside a function, to store a value into a local variable in the caller.
On Thu, Aug 18, 2011 at 6:46 AM, Linda Walsh wrote:
>
>
>
> ` Eric Blake wrote:
>>
>> On 08/15/2011 04:40 PM, Sam Steingold wrote:
* Andreas Schwab [2011-08-15 22:04:04 +0200]:
Sam Steingold writes:
>
> Cool. Now, what does this imply?
"For almost every purpo
34 matches
Mail list logo