:: Re: [DNG] bash / quote weirdness
Forside
Slet denne besked
Besvar denne besked
Skribent: Steve Litt
Dato:  
Til: dng
Emne: Re: [DNG] bash / quote weirdness
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 | ---
>>
>>     1) "cat -n"
>>
>>     2) /etc/fstab
>>
>> Of course, the system has no command named "cat -n".  (And only a
>> chaotic evil person would use a space in a command's name.)
>> Something like "cat"  "-n"  /etc/fstab
>
>Maybe to keep anyone from executing a potentially danterous command by
>mistake?


Yeah, that too.

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques