I came across an interesting warning while googling an issue: apparently chowning another user's home directory will change your own home directory? That is what is warned here: http://www.ambience.sk/old/user-account-copy-linux Search that page for commenter hollerith's comments, which another commenter verifies.
Thanks.
On Sat, 28 May 2011 16:02:13 +0300, DC wrote:
I came across an interesting warning while googling an issue: apparently chowning another user's home directory will change your own home directory? That is what is warned here: http://www.ambience.sk/old/user-account-copy-linux Search that page for commenter hollerith's comments, which another commenter verifies.
Nonsense. Couldn't you have quoted the relevant command-line? It uses
/home/newuser/.*
which is _not_ "another user's home directory", because the .* also includes .., the parent directory, which in this case is /home.
On Sat, May 28, 2011 at 16:23, Michael Schwendt mschwendt@gmail.com wrote:
On Sat, 28 May 2011 16:02:13 +0300, DC wrote:
I came across an interesting warning while googling an issue: apparently chowning another user's home directory will change your own home directory? That is what is warned here: http://www.ambience.sk/old/user-account-copy-linux Search that page for commenter hollerith's comments, which another commenter verifies.
Nonsense. Couldn't you have quoted the relevant command-line? It uses
/home/newuser/.*
which is _not_ "another user's home directory", because the .* also includes .., the parent directory, which in this case is /home.
It looks to me that the gentleman who wrote the article tried to address dotfiles with that command without thinking about the . and .. files. I didn't think about those either until you made it explicit, and now I understand what the issue it.
Thanks.
Hi Michael,
On Sat, May 28, 2011 at 6:23 AM, Michael Schwendt mschwendt@gmail.com wrote:
because the .* also includes .., the parent directory, which in this case is /home
A quick question, how can one use globs to expand only dotfiles without including ".."?
On Sat, 2011-05-28 at 12:18 -0700, suvayu ali wrote:
Hi Michael,
On Sat, May 28, 2011 at 6:23 AM, Michael Schwendt mschwendt@gmail.com wrote:
because the .* also includes .., the parent directory, which in this case is /home
A quick question, how can one use globs to expand only dotfiles without including ".."?
$ ls .[^.]*
poc
On Sat, May 28, 2011 at 3:45 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
On Sat, 2011-05-28 at 12:18 -0700, suvayu ali wrote:
Hi Michael,
On Sat, May 28, 2011 at 6:23 AM, Michael Schwendt mschwendt@gmail.com wrote:
because the .* also includes .., the parent directory, which in this case is /home
A quick question, how can one use globs to expand only dotfiles without including ".."?
$ ls .[^.]*
Thanks a lot Patrick, I had no idea ls accepted regular expressions!
poc
On Sat, 2011-05-28 at 20:03 -0700, suvayu ali wrote:
I had no idea ls accepted regular expressions!
I was under the impression that the shell handler does *all* of those wildcarding tricks, before handing over to the program.
On Sat, 2011-05-28 at 20:03 -0700, suvayu ali wrote:
On Sat, May 28, 2011 at 3:45 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
On Sat, 2011-05-28 at 12:18 -0700, suvayu ali wrote:
Hi Michael,
On Sat, May 28, 2011 at 6:23 AM, Michael Schwendt mschwendt@gmail.com wrote:
because the .* also includes .., the parent directory, which in this case is /home
A quick question, how can one use globs to expand only dotfiles without including ".."?
$ ls .[^.]*
Thanks a lot Patrick, I had no idea ls accepted regular expressions!
It doesn't. You need to read up on how the Shell works.
poc
On Sun, 2011-05-29 at 12:42 +0930, Tim wrote:
On Sat, 2011-05-28 at 20:03 -0700, suvayu ali wrote:
I had no idea ls accepted regular expressions!
I was under the impression that the shell handler does *all* of those wildcarding tricks, before handing over to the program.
Of course. I merely used ls as an example. I could have used echo.
poc
Hi Patrick,
On Sat, May 28, 2011 at 8:22 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
$ ls .[^.]*
Thanks a lot Patrick, I had no idea ls accepted regular expressions!
It doesn't. You need to read up on how the Shell works.
I was under the impression the shell accepts simple globs like '?' for any single character and '*' for any one or more characters hence I assumed it is an ls feature. I just read the "pattern matching" section in 'man bash' and realised I was misinformed. :)
Thanks a lot.
On Sat, 2011-05-28 at 20:29 -0700, suvayu ali wrote:
Hi Patrick,
On Sat, May 28, 2011 at 8:22 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
$ ls .[^.]*
Thanks a lot Patrick, I had no idea ls accepted regular expressions!
It doesn't. You need to read up on how the Shell works.
I was under the impression the shell accepts simple globs like '?' for any single character and '*' for any one or more characters hence I assumed it is an ls feature. I just read the "pattern matching" section in 'man bash' and realised I was misinformed. :)
The use of regular expressions for filename matching dates back to the beginnings of Unix. In fact on 16-bit machines it was actually done in a separate program called /etc/glob, called by the Shell when needed, since otherwise the Shell process would have been too big for the address space (64Kb :-). Those days have long gone of course.
BTW this is where we get the verb "globbing" meaning "filename expansion".
poc
On Sat, May 28, 2011 at 9:01 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
I was under the impression the shell accepts simple globs like '?' for any single character and '*' for any one or more characters hence I assumed it is an ls feature. I just read the "pattern matching" section in 'man bash' and realised I was misinformed. :)
The use of regular expressions for filename matching dates back to the beginnings of Unix. In fact on 16-bit machines it was actually done in a separate program called /etc/glob, called by the Shell when needed, since otherwise the Shell process would have been too big for the address space (64Kb :-). Those days have long gone of course.
BTW this is where we get the verb "globbing" meaning "filename expansion".
Always a pleasure every time you pitch in with these wonderful historical anecdotes. :)
poc