[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: User rw Permissions on New Hard Drive



On Fri 01 Mar 2019 at 12:00:06 (-0500), Greg Wooledge wrote:
> On Fri, Mar 01, 2019 at 10:52:00AM -0600, David Wright wrote:
> > On Fri 01 Mar 2019 at 01:30:47 (-0500), Cindy-Sue Causey wrote:
> > > That's what I'd been thinking, too. Because of your question, I just
> > > tried a search for...
> > > 
> > > "defaults,rw" /etc/fstab
> > 
> > You've really limited what can be found with that string.
> > For example, you won't find rw,defaults. But the shell
> > makes a more productive search string look like toothpick-hell:
> > 
> > $ grep '\(rw\)\|\(defaults\)' /etc/fstab
> > 
> > will match lines with either word.
> 
> *shudder*  You don't need ANY of those parentheses, let alone escaped
> parentheses.  And you're relying on a GNUism to make the | work instead
> of just calling grep -E or egrep like you're supposed to.
> 
> grep -E 'rw|defaults' /etc/fstab

Sorry. I think I've been writing too much sed recently, making my
audio and video configurations switch between monitor and HDMI.

> If you wanted to match lines that have BOTH strings, then try
> <https://mywiki.wooledge.org/BashFAQ/079> instead.

Your FAQs are well worth reading, as always. So much reading,
so little time. (Opposite of another well known poster.)

Cheers,
David.


Reply to: