Product SiteDocumentation Site

8.6. Skallomgivelser

Kommandotolker (eller skjell) kan være en brukers første kontaktpunkt med datamaskinen, og de må derfor være ganske vennlige. De fleste av dem bruker initialiseringsskript som tillater oppsett av hvordan de virker (automatisk fullføring, ledetekst, etc.).
bash, standardskjellet bruker /etc/bash.bashrc-initialiseringskriptet «interaktive» skall, og /etc/profile for «login» skall.
Enkelt sagt, et innloggingsskall startes når du logger på til konsollen enten lokalt eller eksternt via ssh, eller når du kjører en eksplisitt bash --login-kommando. Uansett om det er en login skall eller ikke, kan et skall være interaktivt (i en for eksempel xterm-type terminal); eller ikke-interaktivt (ved å kjøre et skript).
For bash er det nyttig å utføre «auto-fullføring». Pakken bash-completion inneholder disse fullføringene for de vanligste programmene og er vanligvis påskrudd his brukerens .bashrc-oppsettsfil ble kopiert fra /etc/skel/.bashrc. Ellers kan det skru på via /etc/bash.bashrc (der det bare er å utkommentere noen linjer) eller /etc/profile.
In addition to these common scripts, each user can create their own ~/.bashrc and ~/.bash_profile to configure their shell. The most common changes are the addition of aliases; these are words that are automatically replaced with the execution of a command, which makes it faster to invoke that command. For instance, you could create the la alias for the command ls -la | less command; then you only have to type la to inspect the contents of a directory in detail. Please note that the shell needs to be reinitialized after adding an alias, e.g. by starting a new shell.
Setting default environment variables is an important element of shell configuration. Leaving aside the variables specific to a shell, it is preferable to place system wide variables in the /etc/environment file, since it is used by the various programs likely to initiate a shell session. Variables typically defined there include ORGANIZATION, which usually contains the name of the company or organization, and HTTP_PROXY, which indicates the existence and location of an HTTP proxy. Other options include to set system wide variables via scripts in /etc/profile.d, or session wide variables via .pam_environment or .profile, where the latter can override any definition contained in the first. The file /etc/default/locale is meant to contain system wide locale related environment variables.