########### START the SERVER
su - ortest<<!
!
/apps/ortest/VIS/db/tech_st/11.1.0/bin/sqlplus " /as sysdba"<<!
startup
exit
!
lsnrctl start VIS
exit
su - aptest <<!
cd /apps/aptest/VIS/inst/apps/VIS_apps/admin/scripts
./adstrtal.sh apps/apps
!
First line says that I have to be ortest and get the environment variables. As this user the script till lsnrctl start VIS and exit have to be executed.
Similarly for aptest users.
Thanks in anticipation.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason:Topic automatically closed 6 months after creation. New replies are no longer allowed.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak
Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
I believe it is required - at least I've never had any luck running a bash script without that code at the beginning.
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part" "We're just the guys to do it” Animal House
########### START the SERVER
su - ortest<<!
!
/apps/ortest/VIS/db/tech_st/11.1.0/bin/sqlplus " /as sysdba"<<!
startup
exit
!
lsnrctl start VIS
exit
...
...
Is that suppose to be a HERE Doc? Just guessing here, but I wouldn't use an exclamation point; That has meaning to bash.
Yeah, I was just about to ask the same thing as the previous poster. Definitely looks like you were shooting for a heredoc. The exclamation mark works for a heredoc (just tested it), but you've got nothing in it, so su has nothing to do except, likely, attempt to log in as the actual root user (not like sudo) which is disabled (locked password) in Ubuntu and most if not all distributions based off it, including Mint. Even if it were accepted, or you had something in the heredoc, su complains that it must be run "from a terminal"; it needs user input, interactively, probably for security reasons.
Are you just trying to run commands as the root user, without logging in as the root user, as it were? If so, and you have sudo installed, I recommend using sudo ("substitute user do"), which is in my opinion the better and safer tool for the job now anyway. I would use something like: sudo CMD Where CMD is the command you want to run with root privileges. Although adding sudo into scripts is something I avoid.
Last edited by Termy on Fri Mar 30, 2018 2:29 pm, edited 2 times in total.
I think he's using su to run different parts of the script as different users (ortest and aptest); not as root.
maybe make an ortest-commands script and an aptest-commands script, then this could call each individually
something along the lines of