Project and Portfolio Management Practitioners Forum
cancel

Trying to ksc script user names

Highlighted
Mika Epstein
New Member.

Trying to ksc script user names

Normally we have a very baked process where we run commands as ENV-APP on a unix server

So a command would run in TEST for DUO as the ID TEST-DUO out of the /usr/appl/duo/test folder

Enter some goofy people who want to run as UNO-TEST instead.

I wrote a shell script to parse what the name should be, and I understand the basics for the ksc script and how to pass info into it. How do I get info back out again? That is, after I run

./myscript.sh UNO TEST

How can I set that as a temp variable to then sudo as TEST-DUO or UNO-TEST?
1 REPLY
Jason Nichols K
Acclaimed Contributor.

Re: Trying to ksc script user names

Mika,

When you run a local script, like ./myscript.sh, you can use

ksc_set TMP_TOKEN '[EXEC.OUTPUT]'

and it will put the output of your script into a temporary token. The [EXEC.OUTPUT] token is the output generated from the previous command line. If you are trying to capture the output of the script into a shell variable, you can do

TMPVAR=`./myscript.sh`

Depending on your shell, you may also need to export TMPVAR. Also note that the quotes are the back quotes (under the ~ key). I hope this helps and didn't confuse you. If you need any clarification or further explanation, don't hesitate to ask.

Jason