[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] .profile difference




> as regards to features. bash has so many more little additions that it really 
> needs it's own config file. e.g. try using a pure POSIX shell like ash with 
> all your shell scripts.

Well, this is true, which is why I write shell scripts in either ksh or sh 
syntax :) I don't know anyone that uses ash as a login shell though...prolly 
used somewhere mind :)

> 
> Not sure where zsh fits in exactly.

zsh is one of those really weird advanced shells that I look at every now and 
then. It looks ridiculously powerful and probably akin to using perl as your 
shell :) The man page doesn't help by being split up over more than a dozen 
pages overall. zsh uses its own profiles /etc/zprofile, $HOME/.zprofile etc).

Other shell contenders are csh/tcsh which also use completly seperate files, 
$HOME/.cshrc, $HOME/.login, /etc/csh.cshrc and /etc/csh.login; the *.login 
ones being used for the login shell whilst the *.cshrc ones are parsed on 
every invocation of the shell.

The ksh/bash equivalent to .cshrc is setting $ENV in .profile to point to 
some script (eg, I use ENV=$HOME/.ksh_env; export ENV). Then the script 
pointed to by $ENV is excuted for each shell invocation whilst .profile is 
executed only for login shells. If $ENV is not set, no script is executed at 
each shell invocation. /bin/sh has no $ENV/.cshrc equivalent[1].

Chris...
[1] traditionally; however as sh points to bash on most systems, you can 
exploit
	the feature.

-- 
\ Chris Johnson           \ NP: Front Line Assembly - 11. The Blade (Worldwi
 \ cej [at] nightwolf.org.uk    ~-----,  de Mix) 
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------, 
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____


___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.