Showing posts with label HP-UX. Show all posts
Showing posts with label HP-UX. Show all posts

Thursday, September 25, 2008

How do I find the name of the current shell that I am working in

There is a command that will work on all platforms I tested (HP-UX, SunOS, Linux, MacOS) and shells (sh,ksh,bash,csh,zsh)

ps -p $$ | grep $$ | awk '{ print $NF }'

Be aware that the shell name can be bash or -bash

Wednesday, April 9, 2008

HP-UX - group permissions issue

Let's assume that there is a guy user name paul who's main group is developer.
His home directory belongs to paul:developer.

Now, let's assume my main group is users, and the developer group is my secondary one.

You would expect, probably, that I could do cd ~paul if only paul's home directory had g+rx attribute, right?

Well, on HP-UX (at least) it does not have to be like that. I don't know if this is by default or not but what I have found out on our HP-UX machine is that there are two files in the /etc dirtectory - group, and logingroups.

For sure you know the /etc/group file!
I bet you might not see the /etc/logingroups file, though.

Now, if you want to make HP-UX behaving like other machines, you can simply create a link:

ln -s /etc/logingroups /etc/group

After this change my user will be able to do cd ~paul.