"ksh -" as login shell bypassing .profile


 
Thread Tools Search this Thread
Operating Systems AIX "ksh -" as login shell bypassing .profile
# 1  
Old 04-17-2009
"ksh -" as login shell bypassing .profile

Hi all,

I am currently trying to tell /bin/ksh to behave like a login shell. I am invoking it from an interactive shell. In the documentation is stated, that calling it with
Code:
exec ksh -

it should behave like a login shell, work 1st on /etc/profile, ~/.profile and so on.
I tried that with different quotations but had no success, usually nothing happened or session closed etc..
Doku:
pSeries and AIX Information Center

I then found a hint on some page that invoking it with a small C-program should help and indeed it worked:
Code:
#include <stdio.h>
#include <unistd.h>

int main(void)
{
     execl("/bin/ksh","-",0);
     return 0;
}

Problem with this is, it has to be compiled for different versions of AIX. So I'd rather like a solution solely with shell commands if possible.

Sadly I found no other option in the man page for ksh to tell it to read .profile ie. behave like a login shell. For pdksh, bash, (ksh93 I think too) etc. there are such options, but I can't use any other but plain /bin/ksh in this case.

Thanks for any hint in forward.

Last edited by zaxxon; 04-20-2009 at 05:52 AM.. Reason: syntax
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"ksh: XYZ: parameter not set" in .profile

Hi, A very basic query. I am working on two different UNIX servers and I see different behaviours for my user id. This has to be a setting in the .profile, but I can't seem to find where :confused: So, in one server if I type echo $XYZDD (a random variable), I get a blank line with no... (2 Replies)
Discussion started by: ALDonP
2 Replies

2. Shell Programming and Scripting

Shell script using expect to login to couple of remote servers and read "crontab -l"

I need a shell script using expect to login to couple of remote servers and read "crontab -l -u <username>" & "cat /etc/rc.local" & "df -h" and able to create output into a file saved locally with hostname.crontab & hostname.rc.local & disk.status. I can supply a file as list of hostname or IP... (4 Replies)
Discussion started by: jaipsharma
4 Replies

3. Shell Programming and Scripting

ksh script that echo " please insert your name " and store the output to a login.log file.

Hello All Nice to meet you all here in this forum, it's my 1rst time here i'm asking about a little issue that i face i added a ksh script that echo " please insert your name " and store the output to a login.log file. the script is working fine with normal telnet but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies

4. UNIX for Dummies Questions & Answers

how to install "source" command!/ broken "login.cl"!

Hello, I am new to this forums and this is my first "asking help" message! i have 2 problems: 1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory! 2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Discussion started by: astrosona
0 Replies

5. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

6. Shell Programming and Scripting

In ksh shell command - Print "-ABC" is giving error

Hi Guys, while executing the following command : print "-ABC" is giving following error : ksh: print: bad option(s) I cannot use echo for some other reasons, so any other option ? (2 Replies)
Discussion started by: sagarjani
2 Replies

7. Shell Programming and Scripting

How to get environment of a "fresh" login shell?

Hello fellow *nix users! I am a bit confused how could I get an environment of a "fresh/clean" login shell, that is, the environment at that moment when user has started e.g. a new terminal/console or so. So this is the sequence of actions I should be able to do in a single shell session: ... (6 Replies)
Discussion started by: Miikka
6 Replies

8. Shell Programming and Scripting

ksh script as a login shell return "no controlling terminal"

I have created a ksh shell script and used it as a login shell for a user. </etc/passwd> lramirev:x:111:200:Luis:/export/home/menush:/usr/local/menush/menush My shell script is like this: </usr/local/menush/menush> #!/bin/ksh # if ] then . $HOME/.profile fi ... (8 Replies)
Discussion started by: lramirev
8 Replies

9. UNIX for Dummies Questions & Answers

Where can I read about the difference between "..profile" and ".profile"

Hi I know from reading O Riley's Classic Shell Scripting' that the .profile file is " the shells configuration file" but I am unable to find a reference to what "..profile" means. I have searched on the net, Sams Teach Yourself Unix, Unix Visual Quickstart Guide and Linux in a Nutshell. I have... (2 Replies)
Discussion started by: zorrokan
2 Replies

10. UNIX for Dummies Questions & Answers

No utpmx entry: you must exec "login" from lowest level "shell"

Hi I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message No utpmx entry: you must exec "login" from lowest level "shell" :confused: What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies
Login or Register to Ask a Question