0

How to make it work?

#!/bin/csh
newgrp user_grp2
echo ok

"echo ok" is not executed until I write exit in the console. This is sample code. How to make it work?

I ask in another way: when i run some script with command which has starting a subshell, and i need to not stop executing script after create subshell, then what can i do? Is there any way to do it?

1 Answer 1

0

Just to understand correctly you jsut want to pass some commands & have them run as user_grp2 ?

If that is the case you can do the following in your script

newgrp user_grp2 <<EOF
echo "This is running as group \$(id -gn)";
touch somefile;
id -gn;
EOF

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .