cshrc to bashrc??

Gary Kline kline at thought.org
Sat Jan 1 21:34:44 UTC 2011

On Sat, Jan 01, 2011 at 11:01:31AM +0100, Polytropon wrote:
> On Fri, 31 Dec 2010 13:15:45 -0800, Gary Kline <kline at thought.org> wrote:
> > 	Anybody know if there is a utility that transforms the /root/.cshrc
> > 	into a bash RC file?After decades, I'm giving up on the csh stuff.
> > 	Need something simpler.
> As far as I know, there is no automatic converter for csh -> sh
> config files. Basically, the C shell has these:
> 	- system-wide:
> 	  /etc/csh.cshrc, /etc/csh.login, /etc/csh.lougout
> 	- per user:
> 	  ~/.cshrc, ~/.login, ~/.logout
> I'm a csh user for most dialog use, because bash's interactive
> abilites force too much interaction (especially regarding
> completition) in the default configuration. But I'm more and
> more thinking to switch to bash permanently, as soon as I've
> beaten bash's misbehaviour out of its source code. :-)

	I didn't/don't know much about bash--other that it seems to be 
	everywhere.  Last night I spent several hours using my own hack
	that translater the csh aliases to bashrc-type aliases.  Finally
	threw in the towel.  

> The system's sh uses /etc/profile and .profile in the same
> manner. Then there is bash, which I think uses the following
> files according to "man bash", section FILES:
> 	/etc/profile
> 		The systemwide initialization file,
> 		executed for login shells
> 	~/.bash_profile
> 		The personal initialization file,
> 		executed for login shells
> 	~/.bashrc
> 		The individual per-interactive-shell startup file
> 	~/.bash_logout
> 		The individual login shell cleanup file,
> 		executed when a login shell exits
> 	~/.inputrc
> 		Individual readline initialization file

	The last one, .inputrc, is a noop to my brain.  And yes, I just
	had my second cup of coffee!  IS there any cheatsheet URL that
	'splains the readline init'z'n stuff?

> You have to know about the different syntax definition for
> both file types, but it's relatively easy.
> setenv ENVNAME envstring	-> ENVNAME="envstring"; export ENVNAME
> 				-> export ENVNAME="envstring"
> set VARNAME = 'varstring'	-> VARNAME="varstring"
> alias aliname 'alistring'	-> alias aliname="alistring"

	Looks at lot like my zsh usage. 

> All the config files allow regular sh coding sequences (such
> as the use of conditionals or iterators).
> To get a standard prompt in bash, use this:
> 	export PS1="\u@\h:\w\$ "
> It is the equivalent to csh's
> 	set promptchars = "%#"
> 	set prompt = "%n@%m:%~%# "
> Note that csh does automatically use % or # according to the
> first setting. I'm not sure how bash handles this.

	I have always ripped off somebody's prompt and then modified it
	to what fits my needs.  Last night I kept running into problems 
	with the PATH and the aliases.  Each re-edit I did I figured it
	would be just-another-minute before bash worked.  Nope, nada,
	zip.  Finally got smart and :quit.


> -- 
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...

 Gary Kline  kline at thought.org  http://www.thought.org  Public Service Unix
           Journey Toward the Dawn, E-Book: http://www.thought.org
          The 7.97a release of Jottings: http://jottings.thought.org

More information about the freebsd-questions mailing list