script execution

to run below script to start web logic
/opt/scripts/bea_start admin
after login i cannot directly execute
i have to go to below directory to execute

cd /xyz/home/user123/opt/def/bea_domains/12/xyz_dev1/servers/xyz_dev1_admin/logs

i though below is absolute path and as soon as i login i should be able to run from
/opt/scripts/bea_start admin

also i have to run as admin only not as my user id

why i cannot run as soon as i login from root directory(if i am not mistaken that is what i go as soon as i login)

also how to see who all can run the script and how to change that script permission so that even if i login i can execute not just admin

Please advise
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
>> after login i cannot directly execute
What do you mean? Do you get an error? Post the error here.

bea_start may want to write a log file, you are allowed to write in ../xyz_dev1_admin/logs

>> also i have to run as admin only not as my user id
admin? linux has no admin, it has root. get sudo rights for you user to allow starting it

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
i did

 cd ~

then when i ran script
bea_start must be run in the directory with the bea_start.config file.
Gerwin Jansen, EE MVETopic Advisor Commented:
So do that then. Go to the folder with the bea_start.config and start it.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Define Login as how you do this... My guess is you're using ssh + let's be sure this is true.

Also provide an ls -l of the script your running + the output of the id command.
gudii9Author Commented:
cd ~
from above root
when i run below
/opt/scripts/bea_start admin
above script will not run

where as

if i go to below path
cd /xyz/home/user123/opt/def/bea_domains/12/xyz_dev1/servers/xyz_dev1_admin/logs

then if i run
/opt/scripts/bea_start admin
it works

what is the difference i do not understand
please advise
Gerwin Jansen, EE MVETopic Advisor Commented:
The working directory is different, check what files it created in ../xyz_dev1_admin/logs -> it cannot create those files in ~

Where is your bea_start.config file?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.