Tag Info

New answers tagged


The manual page for tcsh is the place to start, because it gives an example which can be adapted: For example, alias print 'pr !* | lpr'' defines a ``command'' (`print') which pr(1)s its arguments to the line printer. Thus: alias cd 'cd \!* ; ls' This happens to work (see the section Alias substitution) because tcsh detects the use of cd in the ...


% bindkey | grep word | egrep 'for|back' "^[^H" -> backward-delete-word "^[B" -> backward-word "^[F" -> forward-word "^[b" -> backward-word "^[f" -> forward-word "^[^?" -> backward-delete-word So ESC and then B or F, by default.


"Alt+b" for backwards and "Alt+f" for forwards. Also "Alt+backspace" should delete a word backwards.


For csh-like versus Bourne-like, you could do: start=:#||:<<"goto end=" echo "(t)csh code here" if { bindkey >& /dev/null } then echo tcsh endif goto end= echo Bourne-like code here if [ -n "$BASH_VERSION" ]; then echo bash fi end=: Explained: start=: would be treated as a label declaration in csh, and variable assignment in sh, so ...

Top 50 recent answers are included