PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

Ubuntubinsh default how


Your Ad Here

Your Ad Here

When a shell starts up, it determines two things:

- is it a login shell?

- is it an interactive shell?

The behavior of the shell depends quite critically on those two questions. They may seem related, and certainly often login shells are interactive, but technically, these are independent questions.

There are two ways I know of, that a shell decides it is a login shell. This may sound mysterious to you, and I will try to explain it better subsequently: If the shell has been started with an argument zero that starts with a hyphen (-), it is a login shell. The other method applies to bash - I think it also applies to bash if it is started using a link frombin-sh - the option -l or --login.

If a shell has both its standard input and its standard error connected to a "tty", it is an interactive shell. This is always the case for shells running in a terminal window.

If a shell is both interactive and a login shell, it will execute commands frometc-profile. After that, it will look for ~-.bashprofile, ~-.bashlogin, and ~-.profile, in that order, and reads and executes commands from the first one that exists and is readable. So, if you have a file .bashlogin, that file will be executed, and .profile will not be.

You may think that you start programs by typing their names on a command line. However, that command line is read by another program, the shell, and the shell starts the program you named. In other words, all programs are started by some other program, except "init" and a few others, that are started directly by the kernel, on the kernel's own initiative.

When a program A starts a program B, it uses a system call to do so, and that system call takes a few arguments. To avoid any confusion, let us call them "exec arguments". One is the file name of a file containing the program to be started, another is a list of strings, called the "command line arguments". Conventionally, the first "command line argument" is the name of the file, repeated from the first "exec argument". Most programs don't look at the first command line argument, but at the rest. Usually the command line arguments are numbered starting from zero, and the zeroth argument is often just disregarded, making the second argument, numbered "one", the "first".

However, convention is not obligation, and technically, it is possible to start a program with anything in the first command line argument. An important example is the login program, which, when it starts a shell, adds a hyphen in front of the file name in command line argument zero. The shell looks for this hyphen, and decides it is a login shell.

I believe you can determine this by typing "echo $0", and see if it starts with a hyphen. If you use the command "su - root", you should also find that the shell has a hyphen in its "$0". You could also look at the output from ps. However, ps has several possible places to look for the program name, so depending on the options to ps, you may be seeing the first "exec argument", which is stored by the kernel, or the first "command line argument". Another thing to note here is that the command line arguments are stored in the process, so the process can modify them. (A process is a running instance of a program.) This happens with e.g., sendmail; ps -ef grep sendmail, if you run sendmail, may show

sendmail: accepting connections

which are not the command line arguments that were used to start the program. I mention this so you know not to believe everything you see here.

Now you can start looking for information on how your terminal windows do when they start a shell, and how to configure that. The first question is, of course: What terminal window program are you using? Try this: "ps -ef f less" (notice the extra 'f'). Now in "less", type "-sh" to search for instances of bash or sh, and then follow the line graphic back to the parent process. That should tell quite reliably what terminal program you are using. (Of course, if you are running virtual terminals, you may find the parent process runs "-sbin-login".)

If it's gnome-terminal, there is unfortunately no man-page for it,

gnome-help ghelp:---usr-share-gnome-help-gnome-terminal-C-gnome-terminal.xml

and there, under Preferences it says:

To configure GNOME Terminal, choose Edit Current Profile

and in section 4.2 "breastle and Command" (who would guess that...) it says

how to see the list of all the function names 7201
Robert M. Riches Jr. said the following, on 12-15-05 17:30: snip comments on geriatric version of RedHat From what the OP wrote, I think he is getting...

Run command as a login shell

Index File Contents under Linux
Sun and said: Maybe, but first you'll have to define "index" more rigorously. What data do you want to retrieve? Keywords, authors, file size, last-modified date? Do you want...

Select this option to force the command that currently runs inside the terminal to run as a login shell. If the command is not a shell, the setting has no effect.

how to see the list of all the function names 7200
I left HatRed for MandrX a couple of years ago after they abandoned the market segment I'm in.) HatRed 7.3 is terribly old. You should really update to a more modern distro...
Open Source ERPCRM Software, CKERP, v.0.16.1 released
A new release, v.0.16.1, of CK-ERP, has been posted at SourceForge.Net, New features include, 1.Connector for Xaraya...

and

Run a custom command instead of my shell

Select this option to run a specified command, other than the normal shell, in the terminal. Specify the custom command in the Custom command text box.

Questions about the Adaptec AAA131 RAID card
I have an Adaptec AAA-131 RAID and I want to use it in a server I am building and would to actually use the hardware RAID features of this card. I plan to...

The second option allows you to specify "-bin-sh -l". Of course, it is more natural to use "Run command as login shell", which is exactly what you want. But if your terminal window program is not gnome-terminal, and you find it has a way of configuring what program to run, the "-bin-sh -l" may be your friend.

For most other programs, it is a bit harder, as you have to search around to find how to configure them. Quite a few use a kind of configuration database built-in to X, the display server. The entries in this database are often called just "Resources". If you look in the man-page for xterm, search for this word, and you will find there are so many resources that it takes days to read them all. To display the resources currently in effect, try "xrdb -query". To add or change resources, use the command xrdb -merge, like

echo "*.LoginShell true" xrdb -merge

NBie Frustrations
I'm just about to give up on trying Linux (Ubuntu 5.10). This is my first attempt, and I am already pretty disappointed. 1. I can't make Macromedia Flash sites work no matter what...

However, this raises another thorny question: How do you do to have this command executed automatically? You can obviously not put it in .profile ...

You could search your computer for files named Xresources. You will probably findetc-X11-Xresources andetc-X11-xdm-Xresources, and you could add to them. It is also likely that you can create file in your home directory called .Xdefaults, as most X startup systems do look for such a file.

-Enrique



Your Ad Here

List | Previous | Next

how to see the list of all the function names 7200

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

command to find the flavour of linux 7198