?
Solved

GID from ksh

Posted on 1997-06-12
3
Medium Priority
?
324 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
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 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

830 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