help with prompt
am 14.09.2007 14:15:23 von hkg166
I use tcsh and would like to switch to bash. My tcsh prompt
set prompt="mozart %U[%@]%u [%/] "
gives
mozart [7:54am] [/Users/myname/tex/subdirectory]
I could not replicate the same thing in bash. Any suggestions?
Also, how would
alias dvi2ps 'dvips -t letter \!:1.dvi -o \!:1.ps'
be translate into bash?
Thanks..
Re: help with prompt
am 14.09.2007 14:32:07 von Stephane CHAZELAS
2007-09-14, 05:15(-07), hkg166@gmail.com:
>
> I use tcsh and would like to switch to bash. My tcsh prompt
>
> set prompt="mozart %U[%@]%u [%/] "
>
> gives
>
> mozart [7:54am] [/Users/myname/tex/subdirectory]
>
> I could not replicate the same thing in bash. Any suggestions?
Why switching to bash and not zsh?? Especially when coming from
tcsh!
In zsh:
set prompt="mozart %U[%@]%u [%/] "
> Also, how would
>
> alias dvi2ps 'dvips -t letter \!:1.dvi -o \!:1.ps'
[...]
dvi2ps() {
dvips -t letter "$1.dvi" -o "$1.ps"
}
with both bash and zsh (though in zsh the double quotes are not
necessary).
--
Stéphane
Re: help with prompt
am 14.09.2007 14:33:38 von Joachim Schmitz
schrieb im Newsbeitrag
news:1189772123.696206.106860@g4g2000hsf.googlegroups.com...
>
> I use tcsh and would like to switch to bash. My tcsh prompt
>
> set prompt="mozart %U[%@]%u [%/] "
The variable in bash for thie os PS2.
export PS1=
> gives
>
> mozart [7:54am] [/Users/myname/tex/subdirectory]
export PS1="mozart [\@] [\w] "
Not sure what %U and %u is supposed to do.
See the section PROMPTING in bash's man-page
> I could not replicate the same thing in bash. Any suggestions?
>
> Also, how would
>
> alias dvi2ps 'dvips -t letter \!:1.dvi -o \!:1.ps'
>
> be translate into bash?
alias dvi2ps="dvips -t letter \!:1.dvi -o \!:1.ps"
(not too sure about what \!:1 does in tcsh)
Bye, Jojo
Re: help with prompt
am 14.09.2007 15:08:10 von Stephane CHAZELAS
2007-09-14, 12:32(+00), Stephane CHAZELAS:
> 2007-09-14, 05:15(-07), hkg166@gmail.com:
>>
>> I use tcsh and would like to switch to bash. My tcsh prompt
>>
>> set prompt="mozart %U[%@]%u [%/] "
>>
>> gives
>>
>> mozart [7:54am] [/Users/myname/tex/subdirectory]
>>
>> I could not replicate the same thing in bash. Any suggestions?
>
> Why switching to bash and not zsh?? Especially when coming from
> tcsh!
>
> In zsh:
> set prompt="mozart %U[%@]%u [%/] "
[...]
Sorry, you need to take out the "set" in zsh. "set" in Bourne
like shells is to set options (as in set -x, set -C) or set the
positional parameters ($1, $2...), so that the above command
sets "$1" to "prompt=mozart %U[%@]%u [%/] "
--
Stéphane
Re: help with prompt
am 14.09.2007 21:48:39 von cfajohnson
On 2007-09-14, hkg166@gmail.com wrote:
>
> I use tcsh and would like to switch to bash. My tcsh prompt
>
> set prompt="mozart %U[%@]%u [%/] "
>
> gives
>
> mozart [7:54am] [/Users/myname/tex/subdirectory]
>
> I could not replicate the same thing in bash. Any suggestions?
See the PROMPTING section of the bash man page.
PS1="mozart [\@] [$PWD] "
> Also, how would
>
> alias dvi2ps 'dvips -t letter \!:1.dvi -o \!:1.ps'
>
> be translate into bash?
Use a function:
dvi2ps()
{
dvips -t letter "$1.dvi" -o "$1.ps"
}
--
Chris F.A. Johnson, author
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Re: help with prompt
am 15.09.2007 00:16:20 von hkg166
Thank you all. I am switching to bash just because it is the default
in OS X. Jedit, for example, seems to have modules compiled for bash.
THanks again.
On Sep 14, 3:48 pm, "Chris F.A. Johnson" wrote:
> On 2007-09-14, hkg...@gmail.com wrote:
>
> > I use tcsh and would like to switch to bash. My tcsh prompt
>
> > set prompt="mozart %U[%@]%u [%/] "
>
> > gives
>
> > mozart [7:54am] [/Users/myname/tex/subdirectory]
>
> > I could not replicate the same thing in bash. Any suggestions?
>
> See the PROMPTING section of the bash man page.
>
> PS1="mozart [\@] [$PWD] "
>
> > Also, how would
>
> > alias dvi2ps 'dvips -t letter \!:1.dvi -o \!:1.ps'
>
> > be translate into bash?
>
> Use a function:
>
> dvi2ps()
> {
> dvips -t letter "$1.dvi" -o "$1.ps"
>
> }
>
> --
> Chris F.A. Johnson, author
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
> ===== My code in this post, if any, assumes the POSIX locale
> ===== and is released under the GNU General Public Licence