On id not giving output. id could be an alias or something. Try some of these commands:
newgrp varies quite a bit between the various OS flavours and versions, so we need you environment before going on. Also it would be worth describing why you think you need to use newgrp as other options may work better.
I'd like to make an alias of commands which contains the command newgrp.
exple:
alias my_cmde newgrp toto; my_pg &
this line doesn't work. why ?
Thanks for your help (2 Replies)
I want to do these commands in a script:
if the user name is 'toto' then the user switch to the group toto_group and then 2 others scripts are launched.
Unfortunately, after the command 'newgrp' the 2 scripts are not launched correctly.
But if I do the same, by hand, one line per one line, it... (11 Replies)
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Hi,
I have to add the 'newgrp' command to my login (.cshrc) script.
The problem is that if I add it, it comes to infinite look, since newgrp opens new shell again and again.
How to automate the newgrp when I have to login, and avoid that loop?
Currently I'm thinking of a condition that... (2 Replies)
Hello all,
I am having an issue setting up an environment on .profile. I want to set up my .profile in that way that everytime I login to the host, it should automatically set up my group. I tried the folllowing but it doesn't work. It is on the solaris OS.
HOSTNAME=$(hostname)
if ] || ]... (14 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
#masterscript.sh
./callingscript.sh
echo $fileExist
#callingscript.sh
echo "The script is called"... (2 Replies)
I have a handful of users who can't 'newgrp' to one specific group from Solaris 9 and 10 nodes and always get this prompt:
newgrp: Password:
We never get prompted by 20+ other groups and this group never prompts for a password from Red Hat Linux nodes. Authentication comes from AD and there's... (4 Replies)
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
LEARN ABOUT SUSE
newgrp
newgrp(1) General Commands Manual newgrp(1)NAME
newgrp - change effective group ID sg - execute command with different group ID
SYNOPSIS
newgrp [-l] [group]
sg group -c command
DESCRIPTION
The newgrp command changes the user's real and effetive group ID by replacing the current shell with a new shell. A new shell is launched
even if an error occours.
A password is requested if the group has a password and the user is not listed in the group file as being a member of that group. The pass-
word can be changed with the gpasswd(1) command.
If the new effective group ID is not in the supplementary group list, newgrp will add the new group ID to the supplementary list, too.
With no operands and options, newgrp changes the user's group IDs (real and effective) back to the group specified in password and group
file.
The sg command works like the newgrp command, except that it executes the given command with /bin/sh and upon exit the group ID of the cur-
rent shell is not changed.
OPTIONS -l, --login
reinitialize the environment as if the user logged in.
--help Print a help list.
-u, --usage
Print a short usage message.
-v, --version
Print program version.
SEE ALSO gpasswd(1), group(5), passwd(1), passwd(5), su(1)AUTHOR
Thorsten Kukuk <kukuk@suse.de>
pwdutils April 2004 newgrp(1)