Re: Migrating from tcsh to bash (issues)

2009-02-05 Thread Simos
On Thu, Feb 5, 2009 at 7:12 PM, Matthew Woehlke wrote: > Simos wrote: >> >> Regarding printexitvalue, I use >> >> trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then >> echo "Exit $__exit_value_bashrc"; fi' ERR >> >> so that an exit value is printed when it is other than 0. > > T

Re: Migrating from tcsh to bash (issues)

2009-02-05 Thread Matthew Woehlke
Simos wrote: Regarding printexitvalue, I use trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then echo "Exit $__exit_value_bashrc"; fi' ERR so that an exit value is printed when it is other than 0. That shouldn't be necessary. An exit of 0 is not considered an error, and so

Re: Migrating from tcsh to bash (issues)

2009-02-04 Thread Chet Ramey
Stephane CHAZELAS wrote: > > Oops! I hadn't realised we were on the bash newsgroup/ML. Sorry > for the troll. It's ok. We're a friendly bunch. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/

Re: Migrating from tcsh to bash (issues)

2009-02-04 Thread Stephane CHAZELAS
2009-02-3, 22:07(+00), Simos: > On Tue, Feb 3, 2009 at 9:24 PM, Stephane CHAZELAS > wrote: >> 2009-02-3, 19:38(+00), Simos: >> [...] >>> I have been using tcsh for a long time and I plan to move to bash. >> [...] >> >> I'd recommend moving to zsh instead. The transition is easier >> from tcsh and

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Simos
On Tue, Feb 3, 2009 at 9:24 PM, Stephane CHAZELAS wrote: > 2009-02-3, 19:38(+00), Simos: > [...] >> I have been using tcsh for a long time and I plan to move to bash. > [...] > > I'd recommend moving to zsh instead. The transition is easier > from tcsh and this way to won't have to move from bash

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Stephane CHAZELAS
2009-02-3, 19:38(+00), Simos: [...] > I have been using tcsh for a long time and I plan to move to bash. [...] I'd recommend moving to zsh instead. The transition is easier from tcsh and this way to won't have to move from bash to zsh later on. -- Stéphane

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Simos
Thanks Paul, Freddy, Chet. Regarding printexitvalue, I use trap '__exit_value_bashrc=$?; if [ $__exit_value_bashrc -ne 0 ]; then echo "Exit $__exit_value_bashrc"; fi' ERR so that an exit value is printed when it is other than 0. I pushed all changes to http://github.com/simos/bashrc/ Cheers, S

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Chet Ramey
Simos wrote: > 4. Does the 'set watch(0 any any)' command in tcsh have an equivalent > in bash; It makes the shell to keep track of /var/log/wtmp, and report > when other users login/logout. > There was a thread in 2000 at > http://www.linux.ie/old-list/17375.html > Is there a built-in command for

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Freddy Vulto
My mistake, the 'trap' of (5) needs to be defined within single quotes to prevent the $? from expanding too soon: $ trap 'echo Exit $?' ERR Freddy Vulto

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Freddy Vulto
3. Put this in your ~/.inputrc # Produce list of all possible completions at single tab set show-all-if-ambiguous on 4. ? 5. You can set a 'trap': $ trap "echo Exit $?;" ERR $ wc /tmp/qqwoieuqo wc: /tmp/qqwoieuqo: No such file or directory Exit 1 $ trap - ERR

Re: Migrating from tcsh to bash (issues)

2009-02-03 Thread Paul Jarc
Simos wrote: > alias -- ../='cd ..' > alias -- .../='cd ../..' > alias -- /='cd /' You can do those as shell functions: ../() { cd ../; } .../() { cd ../..; } /() { cd /; } > 2. An issue with PS1 is that there is no \w or \W version that can > expand the ~. My aim is to get to show the full path