From: Stephane CHAZELAS on
2010-02-09, 07:56(+00), Seebs:
[...]
> So, what do you think /usr/bin/.././bin/./../bin is?
[...]

Hard to tell. It depends whether /usr/bin and /usr/bin/../bin
are a symlink or not, and whether that path is given to the "cd"
builtin command of a POSIX shell (without the -P option) or any
other command or system call.

And remember that when symlinks are involved, there can be
several paths to a directory (though generally only one path
with only non-symlinks components).

--
St�phane
From: Barry Margolin on
In article
<0.84f21d146d89e529f6a1.20100209142434GMT.87mxzisd0d.fsf(a)bsb.me.uk>,
Ben Bacarisse <ben.usenet(a)bsb.me.uk> wrote:

> 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

No message in this thread was cross-posted to that group. Maybe he
posted a duplicate of the message there.

But his questions seemed to be about Unix in general, not specific to
any particular programming language.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Ed Morton on
On 2/9/2010 11:32 PM, Barry Margolin wrote:
> In article
> <0.84f21d146d89e529f6a1.20100209142434GMT.87mxzisd0d.fsf(a)bsb.me.uk>,
> Ben Bacarisse<ben.usenet(a)bsb.me.uk> wrote:
>
>> 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
>
> No message in this thread was cross-posted to that group. Maybe he
> posted a duplicate of the message there.

I think Ben was just suggesting that that would be a group specific to perl,
equivalent to comp.lang.awk for awk, in response to my asking if there was such
a thing.

> But his questions seemed to be about Unix in general, not specific to
> any particular programming language.

Right, but if you read further down in his post you'd see the script he was
working on was a perl script (see below). That potential confusion is why I
suggested he specifically say he's looking for a perl answer if that is the case.

Ed.

>> 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



From: Phred Phungus on
Ed Morton wrote:
> On 2/9/2010 11:32 PM, Barry Margolin wrote:
>> In article
>> <0.84f21d146d89e529f6a1.20100209142434GMT.87mxzisd0d.fsf(a)bsb.me.uk>,
>> Ben Bacarisse<ben.usenet(a)bsb.me.uk> wrote:
>>
>>> 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
>>
>> No message in this thread was cross-posted to that group. Maybe he
>> posted a duplicate of the message there.
>
> I think Ben was just suggesting that that would be a group specific to
> perl, equivalent to comp.lang.awk for awk, in response to my asking if
> there was such a thing.
>
>> But his questions seemed to be about Unix in general, not specific to
>> any particular programming language.
>
> Right, but if you read further down in his post you'd see the script he
> was working on was a perl script (see below). That potential confusion
> is why I suggested he specifically say he's looking for a perl answer if
> that is the case.
>
> Ed.


Thanks all for responses. I'm working up roughly the same material in
several different ways. When I posted that perl script to
comp.lang.perl.misc, they prettymuch all agreed that my trouble wasn't
with the programming language but the unix platform. I have huge
misunderstandings as a relatively recent windows refugee.

So we have:

dan(a)dan-desktop:~$ ls -ld /usr/bin
drwxr-xr-x 2 root root 36864 2010-02-08 19:24 /usr/bin
dan(a)dan-desktop:~$

My next question is how do I determine what the max path is for this
directory.

My gas heater passed inspection today. I feel like I'm 2 meters tall
and bulletproof.
--
fred
From: Phred Phungus on
Janis Papanagnou wrote:
> 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

This is what I've been banging my head against for the last few days.
The clp.misc people recommend that I think of it as
chmod 700 myfile

My question is: how do I go the other way? I know the answer is going
to involve some arithmetic:



A numeric mode is from one to four octal digits (0-7), derived by
adding up the bits with values 4, 2, and 1. Omitted digits are
assumed
to be leading zeros. The first digit selects the set user ID
(4) and
set group ID (2) and restricted deletion or sticky (1)
attributes. The
second digit selects permissions for the user who owns the
file: read
(4), write (2), and execute (1); the third selects
permissions for
other users in the file�s group, with the same values; and the
fourth
for other users not in the file�s group, with the same values.

So for this example, what is the equivalent scalar for the chmod command:

dan(a)dan-desktop:~$ ls -ld /usr/bin
drwxr-xr-x 2 root root 36864 2010-02-08 19:24 /usr/bin
dan(a)dan-desktop:~$ man chmod

?



>
>>
>> What are the roles of the . and .. ?
>
> The current directory and the parent of current directory, respectively.
>
> Janis

Thanks Janis. Forgive my naivete, but doesn't this mean that a
directory contains itself and its parent?

--

Phred