Solved

GID from ksh

Posted on 1997-06-12
3
307 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
Comment Utility
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
Comment Utility
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
Comment Utility
id -a gives all groups. Otherwise it´s the dumb version.

Thanx1
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now