Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem to execute the AIX script

Status
Not open for further replies.

shoux

Technical User
Nov 9, 2000
83
0
0
MY
Hi expert !

I have a script that enables users to get an option to run a backup. However, I faced a problem during execute the process. Problem as follows :-


1. I added the script at the last sentence of .profile. So that after the user login the menu will appear. Unfortunately, the menu doest appears instead the command prompt
2. why we need to type for example # sh abc instead of #abc

I have 2 aix machines. The 1st machine functions accordingly.

Add. Info.
Both running AIX 5.2
Remote login is enable for 1st machine and disable for 2nd machine.

Need your help!

Thank you

Regards


shoux
 

try:

./abc

or,

exec /pathto/abc


or make alias for your script/command.


For security reasons, root account by default hasn't current directory in the PATH.
 
If running a backup and need root access. You may want to get hold of and install sudo and set-up the appropriate access.


( "To become Wise, first you must ask Questions")
 
I second jpor's sudo suggestion, and would expand ogniemi's note to say that, for security reasons, the current directory (".") should never be in anyone's PATH.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 

Thanks for the response
However, I still need more info.for the problem no1

Regards


shoux
 
Hi shoux,

If you log in with the user, and then manually run the script that is started from within the .profile, does that work?If not, what error do you get?

greetz,

R.
 

Hi ! all

Thanks for the prompt response

RMGBELGIUM, it work when we execute from command prompt.As per our requirement the user need to execute from the menu not from the command prompt.that is the reason we requires menu appear when the user login

below is the snapshoot of the .profile

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:. export PATH if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically. /vg/backup.script
logout



below is the file permission for the script.


-rwxrwxrwx 1 root sys 2846 Feb 02 17:00 backup.script




shoux
 
hard to read with the missing end-of-lines but seems like you are trying to execute the backup.script, is that the menu script?

IBM Certified -- AIX 4.3 Obfuscation
 
What is the script name? I don't see anything being called.

If backup.script is the name of the script, it looks like it's got a # . Do you have a return after the "fi" ?
 

Here is the .profile file. the last sentence is the calling script (/vg/backup.script).

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
export PATH
if [ -s "$MAIL" ] # This is at shell startup.in normal
then echo "$MAILMSG" # operation, the shell checks
fi # periodically.
/vg/backup.script # backup.script is the script name.
exit # Logout from the system.

 
What is the permission of the /vg directory.
Should be something like 775
Maybe the full has the appropriate permissions but the user cannot access the directory?




"If you always do what you've always done, you will always be where you've always been."
 
change:
/vg/backup.script # backup.script is the script name.

to:
exec /vg/backup.script # backup.script is the script name.
 
can you show the output of?

ls -ld /vg

I can see you have the script 777

Does the user get any messages when they loggin? After tried putting this as their startup/initial program through "smit user" "change characteristics".

Change you tried to add echo's before and after the script call to make sure the .profile is even getting that far?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top