Solved

GID from ksh

Posted on 1997-06-12
3
315 Views
Last Modified: 2010-07-27
My SVR4 system runs several programs which need their own group id. I use newgrp for users to be able the different programs.

How van I determine the GID choosen to take actions according?

TIA
0
Comment
Question by:jdsmspro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 2006393
On some systems, `id -g` gives you the answer.
I don't remember whether SVR4's id is "nice" or "dumb".
Even in the latter case, though, you can manipulate the output of "id".
0
 
LVL 1

Accepted Solution

by:
henrys earned 100 total points
ID: 2006394
Try this:

(all on one line, of course)

gid=`/usr/bin/id | cut -d ' ' -f 2 | cut -d '=' -f 2 | sed -e 's/(.*)//'`
0
 

Author Comment

by:jdsmspro
ID: 2006395
id -a gives all groups. Otherwise it´s the dumb version.

Thanx1
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question