From: Phred Phungus on 9 Feb 2010 02:46 Hello newsgroup, I've got a grab bag of questions that I think are topical here. Apparently, unix directories have permissions. How do I determine what the permissions are for, say, /usr/bin/ ? What are the roles of the . and .. ? The period here seems to indicate the current directory: #!/usr/bin/perl -w opendir(THISDIR, ".") or die "tja $!"; @allfiles = readdir THISDIR; closedir THISDIR; print "@allfiles\n"; # ./t2.pl >text1.txt Thanks for your comment and cheers, -- fred
From: Janis Papanagnou on 9 Feb 2010 02:54 Phred Phungus wrote: > Hello newsgroup, I've got a grab bag of questions that I think are > topical here. > > Apparently, unix directories have permissions. How do I determine what > the permissions are for, say, /usr/bin/ ? ls -ld /usr/bin Permissions are coded in the first column. For their meaning read man chmod > > What are the roles of the . and .. ? The current directory and the parent of current directory, respectively. Janis > > The period here seems to indicate the current directory: > > #!/usr/bin/perl -w > > opendir(THISDIR, ".") or die "tja $!"; > @allfiles = readdir THISDIR; > closedir THISDIR; > print "@allfiles\n"; > > # ./t2.pl >text1.txt > > Thanks for your comment and cheers,
From: Seebs on 9 Feb 2010 02:56 On 2010-02-09, Phred Phungus <Phred(a)example.invalid> wrote: > Apparently, unix directories have permissions. How do I determine what > the permissions are for, say, /usr/bin/ ? stat, ls -ld, whatever > What are the roles of the . and .. ? "." is the directory itself, ".." is its parent. > The period here seems to indicate the current directory: Any path starts out by default in the current directory. By contrast: /././././. is the same as / and /usr/bin/. is the same as /usr/bin So, what do you think /usr/bin/.././bin/./../bin is? -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Ed Morton on 9 Feb 2010 09:08 On 2/9/2010 1:46 AM, Phred Phungus wrote: > Hello newsgroup, I've got a grab bag of questions that I think are > topical here. > > Apparently, unix directories have permissions. How do I determine what > the permissions are for, say, /usr/bin/ ? > > What are the roles of the . and .. ? Did you notice that the answers you've got so far are for shell, not necessarily for perl? Since this is comp.unix.SHELL rather than comp.lang.PERL, by default you should expect to get shell answers. There are some perl users hang out here too so chances are you will be able to get perl-specific answers if you say up-front in each posting that that's what you're looking for, but there's probably a more appropriate NG out there where you might reach a broader audience of perl experts (like comp.lang.awk for awk). I don't believe it's comp.lang.perl as I think I remember hearing it's not getting used any more but I don't know what the right NG would be, maybe a perl user could chime in.... Ed. > > The period here seems to indicate the current directory: > > #!/usr/bin/perl -w > > opendir(THISDIR, ".") or die "tja $!"; > @allfiles = readdir THISDIR; > closedir THISDIR; > print "@allfiles\n"; > > # ./t2.pl >text1.txt > > Thanks for your comment and cheers,
From: Ben Bacarisse on 9 Feb 2010 09:24 Ed Morton <mortonspam(a)gmail.com> writes: <snip> > Did you notice that the answers you've got so far are for shell, not > necessarily for perl? Since this is comp.unix.SHELL rather than > comp.lang.PERL, by default you should expect to get shell > answers. There are some perl users hang out here too so chances are > you will be able to get perl-specific answers if you say up-front in > each posting that that's what you're looking for, but there's probably > a more appropriate NG out there where you might reach a broader > audience of perl experts (like comp.lang.awk for awk). I don't believe > it's comp.lang.perl as I think I remember hearing it's not getting > used any more but I don't know what the right NG would be, maybe a > perl user could chime in.... It is (or was) comp.lang.perl.misc <snip> -- Ben.
|
Next
|
Last
Pages: 1 2 3 4 5 6 Prev: script to format a csv date Next: pine copy emails back to the server... |