Re: combination of source and && does not result in current alias to be expanded

2025-05-24 Thread Lawrence Velázquez
On Sat, May 24, 2025, at 4:47 PM, Greg Wooledge wrote: > On Sat, May 24, 2025 at 15:00:21 -0500, Bob Mroczka wrote: >>    #!/bin/bash >>    set -o pipefail >>    shopt -s expand_aliases >>    alias ub='echo hi' >>    echo "alias ub='echo bye'" >~/.alias >>    cat ~/.alias >>    source ~/.alias && u

Re: combination of source and && does not result in current alias to be expanded

2025-05-24 Thread Greg Wooledge
On Sat, May 24, 2025 at 15:00:21 -0500, Bob Mroczka wrote: >    #!/bin/bash >    set -o pipefail >    shopt -s expand_aliases >    alias ub='echo hi' >    echo "alias ub='echo bye'" >~/.alias >    cat ~/.alias >    source ~/.alias && ub >    ub I believe you've run into the issue described in this

combination of source and && does not result in current alias to be expanded

2025-05-24 Thread Bob Mroczka
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-

Re: grouping via {} fails after "test $PIPESTATUS"

2025-05-24 Thread microsuxx
true && { false true } || echo no On Sat, May 24, 2025, 4:58 PM Greg Wooledge wrote: > On Sat, May 24, 2025 at 10:43:39 -0400, Steve Newcomb wrote: > > true && { > > echo here 1 > > test "$PIPESTATUS" "!=" "0" > > #echo here 2 > > } || { > > echo here 3 > > } > > Don't do that.

Re: grouping via {} fails after "test $PIPESTATUS"

2025-05-24 Thread Greg Wooledge
On Sat, May 24, 2025 at 10:43:39 -0400, Steve Newcomb wrote: > true && { >     echo here 1 >     test "$PIPESTATUS" "!=" "0" >     #echo here 2 > } || { >     echo here 3 > } Don't do that. && || is NOT a substitute for if. They do not have the sa

grouping via {} fails after "test $PIPESTATUS"

2025-05-24 Thread Steve Newcomb
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux moe 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x