Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Gabe Stanton via Dng
I don't have anything of my own to add except that single quotes result in the same behavior as double quotes in this case. I was curious about that after reading about the difference between single and double quotes in the Advanced Bash Scripting Guide or abs guide. I'm a novice obviously. I

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Steve Litt
Gabe Stanton via Dng said on Thu, 13 Jan 2022 07:03:57 -0700 >There's an html version and a pdf version of the abs guide available >here > >https://tldp.org/LDP/abs/html/ > >or here > >https://tldp.org/LDP/abs/abs-guide.pdf Thank you, thank you, THANK YOU!!! I've needed this for the last 23

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Hendrik Boom
On Wed, Jan 12, 2022 at 05:45:08PM -0500, Steve Litt wrote: > > On the other hand... > > === > [slitt@mydesk ~]$ cat -n /etc/fstab | cut -b 1-20 | head -n5 > 1UUID=730eaf92 > 2UUID=41abb5fd > 3UUID=96cfdfb3 > 4

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Antony Stone
On Thursday 13 January 2022 at 15:07:22, Hendrik Boom wrote: > On Wed, Jan 12, 2022 at 05:45:08PM -0500, Steve Litt wrote: > > [slitt@mydesk ~]$ cat -n /etc/fstab | cut -b 1-20 | head -n5 > > > > 1 UUID=730eaf92 > > 2 UUID=41abb5fd > > 3 UUID=96cfdfb3 > > 4

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Hendrik Boom
On Thu, Jan 13, 2022 at 06:38:56PM +, Simon wrote: > Steve Litt wrote: > > > This is one reason why, in shellscripts, you > > need to quote almost all variables: So they act correctly with the > > space laden filenames that windows dwoobydogs just love to create. > > Not just Windows users.

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Antony Stone
On Friday 14 January 2022 at 00:15:28, Hendrik Boom wrote: > On Thu, Jan 13, 2022 at 12:45:09PM -0500, . via Dng wrote: > > The shell receives a series of tokens, and tries to interpret the first > > one as a command. In the double-quoted attempt above, it gets two > > tokens before the first

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Hendrik Boom
On Thu, Jan 13, 2022 at 12:45:09PM -0500, . via Dng wrote: > > The shell receives a series of tokens, and tries to interpret the first one > as a command.  In the double-quoted attempt above, it gets two tokens before > the first pipe | --- > >     1) "cat -n" > >     2) /etc/fstab > > Of

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Antony Stone
On Thursday 13 January 2022 at 18:19:23, Benjamin Riefenstahl wrote: > Steve Litt writes: > > [slitt@mydesk ~]$ "cat -n" /etc/fstab | cut -b 1-20 | head -n5 > > bash: cat -n: command not found > > [slitt@mydesk ~]$ "cat -n /etc/fstab" | cut -b 1-20 | head -n5 > > bash: cat -n /etc/fstab: No

Re: [DNG] bash / quote weirdness

2022-01-13 Thread . via Dng
On Wed, 2022-01-12 at 00:08 +0100, Florian Zieboll via Dng wrote: Dear list, this im my 'test.sh': #!/bin/bash for f in "$@" ; do xcmd="unrar x" $xcmd "$f" done Can please somebody explain, why, if I double-quote the "$xcmd" variable in line 4, the script fails with

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Simon
Steve Litt wrote: > This is one reason why, in shellscripts, you > need to quote almost all variables: So they act correctly with the > space laden filenames that windows dwoobydogs just love to create. Not just Windows users. I regularly use spaces in file names. There’s an argument that

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Benjamin Riefenstahl
Hi Steve, Steve Litt writes: > [slitt@mydesk ~]$ "cat -n" /etc/fstab | cut -b 1-20 | head -n5 > bash: cat -n: command not found > [slitt@mydesk ~]$ "cat -n /etc/fstab" | cut -b 1-20 | head -n5 > bash: cat -n /etc/fstab: No such file or directory > [slitt@mydesk ~]$ Different code paths within

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Martial Bornet (gmail) via Dng
Hi everyone, to better understand how the shell interprets quotes, you should compile and use the following small C program to test some expressions : $ cat args.c #include    #include    int main(int argc, char *argv[]) {     int         _i;     printf("ARGC = %d\n", argc);     for (_i

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Steve Litt
Antony Stone said on Thu, 13 Jan 2022 15:43:29 +0100 >$ "cat fstab" >bash: cat fstab: command not found > >I have no idea what's really going on here. > > >Antony. Hi Anthony, Different programs handle commands with arguments different ways. sed -e handles the string that follows, which must

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread william moss via Dng
On 1/13/22 09:43, Antony Stone wrote: On Thursday 13 January 2022 at 15:07:22, Hendrik Boom wrote: On Wed, Jan 12, 2022 at 05:45:08PM -0500, Steve Litt wrote: [slitt@mydesk ~]$ cat -n /etc/fstab | cut -b 1-20 | head -n5 1 UUID=730eaf92 2 UUID=41abb5fd 3 UUID=96cfdfb3

Re: [DNG] nftables firewall and fail2ban replacement.

2022-01-13 Thread Simon
Antony Stone wrote: > The one feature I'd like to see on fail2ban is multi-server communication, so > that if one of my machines has a reason to block an address, it tells all my > others to block that address as well. That’s also possible to “roll your own”. I was considering this at my last

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Gabe Stanton via Dng
No problem. Happy that you found it useful :D On Thu, 2022-01-13 at 10:52 -0500, Steve Litt wrote: > Thank you, thank you, THANK YOU!!! > > I've needed this for the last 23 years. Thank you! > > SteveT ___ Dng mailing list Dng@lists.dyne.org

Re: [DNG] [OT] bash / quote weirdness

2022-01-13 Thread Dr. Nikolaus Klepp via Dng
Anno domini 2022 Thu, 13 Jan 15:43:29 +0100 Antony Stone scripsit: > On Thursday 13 January 2022 at 15:07:22, Hendrik Boom wrote: > > > On Wed, Jan 12, 2022 at 05:45:08PM -0500, Steve Litt wrote: > > > > [slitt@mydesk ~]$ cat -n /etc/fstab | cut -b 1-20 | head -n5 > > > > > > 1

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Steve Litt
Hendrik Boom said on Thu, 13 Jan 2022 18:15:28 -0500 >On Thu, Jan 13, 2022 at 12:45:09PM -0500, . via Dng wrote: > >> >> The shell receives a series of tokens, and tries to interpret the >> first one as a command.  In the double-quoted attempt above, it gets >> two tokens before the first pipe |

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Steve Litt
. via Dng said on Thu, 13 Jan 2022 12:45:09 -0500 >The shell receives a series of tokens, and tries to interpret the >first one as a command.  In the double-quoted attempt above, it gets >two tokens before the first pipe | --- > >     1) "cat -n" > >     2) /etc/fstab > >Of course, the system

Re: [DNG] bash / quote weirdness

2022-01-13 Thread Steve Litt
Benjamin Riefenstahl said on Thu, 13 Jan 2022 18:19:23 +0100 >Hi Steve, > >Steve Litt writes: >> [slitt@mydesk ~]$ "cat -n" /etc/fstab | cut -b 1-20 | head -n5 >> bash: cat -n: command not found >> [slitt@mydesk ~]$ "cat -n /etc/fstab" | cut -b 1-20 | head -n5 >> bash: cat -n /etc/fstab: No

Re: [DNG] nftables firewall and fail2ban replacement.

2022-01-13 Thread Didier Kryn
Le 12/01/2022 à 14:49, onefang a écrit : I've been using shorewall and fail2ban for a while now, but nftables is soon replacing iptables, so it's time to consider some options. Apparently fail2ban already supports nftables, but shorewall doesn't and wont -

Re: [DNG] nftables firewall and fail2ban replacement.

2022-01-13 Thread Antony Stone
On Thursday 13 January 2022 at 11:41:48, Didier Kryn wrote: > My experience/understanding of fail2ban is that it's intended > against attackers "smart" enough to periodically change their address. I don't care whether it's individual attackers who change their address, or multiple