:: Re: [DNG] bash / quote weirdness
Top Page
Delete this message
Reply to this message
Author: Steve Litt
Date:  
To: dng
Subject: Re: [DNG] bash / quote weirdness
Benjamin Riefenstahl said on Fri, 14 Jan 2022 10:33:29 +0100

>Hi Steve,
>
>> Benjamin Riefenstahl said on Thu, 13 Jan 2022 18:19:23 +0100
>>>Different code paths within Bash. [...]
>
>Steve Litt writes:
>> This is true, but not the explanation for this particular behavior,
>> as follows:
>>
>> [slitt@mydesk ~]$ /usr/bin/cat -n /etc/fstab | cut -b 1-20 | head -n5
>>      1    UUID=730eaf92
>>      2    UUID=41abb5fd
>>      3    UUID=96cfdfb3
>>      4    UUID=6F66-BF7
>>      5    tmpfs /tmp tm
>> [slitt@mydesk ~]$ "/usr/bin/cat -n" /etc/fstab | cut -b 1-20 | head
>> -n5 bash: /usr/bin/cat -n: No such file or directory
>> [slitt@mydesk ~]$ "/usr/bin/cat -n /etc/fstab" | cut -b 1-20 | head
>> -n5 bash: /usr/bin/cat -n /etc/fstab: No such file or directory
>> [slitt@mydesk ~]$  

>
>I'm sorry, but I don't see it? Can you point out what is suprising to
>you here? Both commands contain "/", and both give the same error
>message.
>
>so long, benny


I thought you were saying that the cause of "cat -n" /etc/fstab being
seen as one command was due to cat not having a full path, so I put a
full path in front of it. If you weren't saying lack of a full path is
the cause of "cat -n" being considered a single command, then my
prepending the full path produces no surprise at all.


SteveT

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