vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I was unable to set PS1 environment variable (prompt) to a customised one when I logged into an AIX box with normal user credentials and then switched over to the root user credentials via a perl script which uses Net::Telnet (CPAN) module. Sourcing the script and changing the .profile file solutions provided on the net and in this group was not helpful as I was not allowed to do any modifications with respect to settings on the box. So, I found a way where I could accomplish this. My Solution: While switching over to other user (say root) which is accomplished through su command, we can send required flags and as well the command to be exceuted. So, I could do it in the following manner: su - root -ip -a -c env;PS1='customized one';PS1; where; -ip: interactive and privileged -a: export all the subsequent parameters (here it is PS1) -c: run the command specified as a string following it Hope this solution could help any one who would encounter similar kind of a problem in the near future. Regards, Rashmi HP Technologies - India |