Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
Spelling, grammar and tag
Source Link
jasonwryan
  • 74.9k
  • 35
  • 204
  • 230

switching user Switching to superuser while shell script is running

I have thea shell script that contains the following lines.:

CURRENT_USER=${USER}
echo $CURRENT_USER
su
echo switch to `who am i`

onceOnce the 2nd line is executed, the shell promptprompts me to enter the root password,. After I provide the correct password and login as admin the last line is not getting executed.

What could be the reason for this issu.issue?

switching user while shell script is running

I have the shell script contains following lines.

CURRENT_USER=${USER}
echo $CURRENT_USER
su
echo switch to `who am i`

once 2nd line is executed shell prompt me to enter root password, After I provide correct password and login as admin the last line is not getting executed.

What could be the reason for this issu.

Switching to superuser while shell script is running

I have a shell script that contains the following lines:

CURRENT_USER=${USER}
echo $CURRENT_USER
su
echo switch to `who am i`

Once the 2nd line is executed, the shell prompts me to enter the root password. After I provide the correct password and login as admin the last line is not getting executed.

What could be the reason for this issue?

Source Link
Isuru
  • 169
  • 2
  • 5

switching user while shell script is running

I have the shell script contains following lines.

CURRENT_USER=${USER}
echo $CURRENT_USER
su
echo switch to `who am i`

once 2nd line is executed shell prompt me to enter root password, After I provide correct password and login as admin the last line is not getting executed.

What could be the reason for this issu.