Skip to Content.
Sympa Menu

baslinux - Re: [BL] shell scripting

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] shell scripting
  • Date: Sat, 8 Jan 2005 17:37:35 +0000 (UTC)


On Sat, 8 Jan 2005 3aoo-cvfd AT dea.spamcon.org wrote:

sindi keesan wrote:

I notice that BL3 has a file /shell (/etc/shell?)
listing four shells

Not usually. Perhaps it was installed with one of
your shell packages?

Maybe each package has a script which adds its own shell?
But bash is not in there - I can add it.


Is bash the default

bash is normally the default in Linux; however, I
used ash in BL3 to save space. For most purposes
the BL3 version of ash is identical to bash.

Is SHELL something you set in the environment?

It is usually set automatically (by login). It
can also be set manually.

Is PS1 a way to set the prompt in ash/bash?

Yes.

You can use tcsh and probably zsh to correct typos
in commands or let you edit them (yes/no/edit).

bash (and the BL3 version of ash) also allow you to
edit the commandline.
But not suggest corrections? I can type the up arrow to get a previous command on screen.


to show me where I am here without pwd.
I don't know why this is not the default.
Is it the default for ash/bash

No.

or was it set that way in profile for BL3?

Yes. PS1='\w<\$>'

Aha, that explains the \w in zsh now - you set it and zsh misinterpreted.

There are also ways (at least in zsh) to set it
to show the time and date.

Also in bash:
----------------------------------------------------
\t the current time in HH:MM:SS format
\d the date in "Weekday Month Date" format
\n newline
\s the name of the shell, the basename of $0
\w the current working directory
\W the basename of the current working directory
\u the username of the current user
\h the hostname
\# the command number of this command
\! the history number of this command
\$ if user is root, a #, otherwise a $
\nnn character corresponding to this octal number
\\ a backslash
\[ begin a sequence of non-printing characters
\] end a sequence of non-printing characters
----------------------------------------------------
Most of those work in ash too.

You can even use colors in the prompt:
--------------------------
PS1='\w\033[31m \$ \033[m'
--------------------------

Cheers,
Steven

____________________________
http://www.basiclinux.com.ru
_______________________________________________
BasLinux mailing list
BasLinux AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/baslinux


keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




Archive powered by MHonArc 2.6.24.

Top of Page