Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #133896

Re: Wildcard and ls

From Lewis <g.kreme@gmail.com.dontsendmecopies>
Newsgroups comp.sys.mac.system
Subject Re: Wildcard and ls
Date 2020-07-30 11:43 +0000
Organization Miskatonic U
Message-ID <slrnri5ci5.15l0.g.kreme@ProMini.lan> (permalink)
References <4K5UG.88504$GQ4.53903@fx02.iad> <5f211067$0$522$65785112@news.neostrada.pl> <tm9UG.96980$r25.75717@fx08.iad> <5f2262be$0$538$65785112@news.neostrada.pl>

Show all headers | View raw


In message <5f2262be$0$538$65785112@news.neostrada.pl> Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> wrote:
> On 29/07/2020 09:15, JF Mezei wrote:
>> On 2020-07-29 02:00, Krzysztof Mitko wrote:
>> 
>>> And that's the problem. Your shell is trying to expand the * wildcard
>>> before sudo is executed and fails because lack of permissions.
>> 
>> 
>> Thanks. That explains the behaviour. I had though that ls did its own
>> wildcarding but in this case, I guess it is sudo that triggers the
>> expansion.
>> 

> Bash triggers the expansion, not sudo.

exactly, it is why this also will not work:

sudo echo "this si a test" >> /etc/passwd

the >> is dealt with by the shell, bit by sudo, so you end up trying to
write text to a prividledged file without sudo permissions.

Also, this has nothing at all to do with macOS, this is how the unix
command line has always worked and the behavior is exactly the same on
Debian and FreeBSD.

> [2] - I *think* csh behaves differently here

It's possible, it's been decades since I used csh, but I am pretty sure
that tcsh behaved the same way ~20 yeas ago.


-- 
Hudd: 'I've just done this radio show where I never met any of the
	other actors and I didn't understand what any of it was about'
Moore: 'Ah, yes I expect that's the thing I'm in.'

Back to comp.sys.mac.system | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Wildcard and ls JF Mezei <jfmezei.spamnot@vaxination.ca> - 2020-07-28 23:07 -0400
  Re: Wildcard and ls Arlen Holder <arlenholder@newmachine.com> - 2020-07-29 05:06 +0000
    Re: Wildcard and ls nospam <nospam@nospam.invalid> - 2020-07-29 01:35 -0400
      Re: Wildcard and ls Arlen Holder <arlenholder@newmachine.com> - 2020-07-29 12:41 +0000
    Re: Wildcard and ls Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2020-07-29 08:04 +0200
      Re: Wildcard and ls Arlen Holder <arlenholder@newmachine.com> - 2020-07-29 12:40 +0000
        Re: Wildcard and ls Arlen Holder <arlenholder@newmachine.com> - 2020-07-29 14:21 +0000
  Re: Wildcard and ls Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2020-07-29 08:00 +0200
    Re: Wildcard and ls JF Mezei <jfmezei.spamnot@vaxination.ca> - 2020-07-29 03:15 -0400
      Re: Wildcard and ls Lewis <g.kreme@gmail.com.dontsendmecopies> - 2020-07-29 09:49 +0000
        Re: Wildcard and ls Jolly Roger <jollyroger@pobox.com> - 2020-07-29 18:45 +0000
          Re: Wildcard and ls Arlen Holder <arlenholder@newmachine.com> - 2020-07-30 02:39 +0000
      Re: Wildcard and ls Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2020-07-30 08:03 +0200
        Re: Wildcard and ls Siri Cruise <chine.bleu@yahoo.com> - 2020-07-30 03:50 -0700
          Re: Wildcard and ls Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2020-07-30 13:40 +0200
          Re: Wildcard and ls Lewis <g.kreme@gmail.com.dontsendmecopies> - 2020-07-30 11:49 +0000
        Re: Wildcard and ls Lewis <g.kreme@gmail.com.dontsendmecopies> - 2020-07-30 11:43 +0000
        Re: Wildcard and ls Barry Margolin <barmar@alum.mit.edu> - 2020-07-30 10:26 -0400
          Re: Wildcard and ls Lewis <g.kreme@gmail.com.dontsendmecopies> - 2020-07-30 14:55 +0000
      Re: Wildcard and ls Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2020-07-30 08:23 +0200

csiph-web