New answers tagged

0

According to this question, you can achieve that by setting: set prompt = "%C3 %" This should show you last three directory names of your CWD, followed by a space and a percent sign.


1

I don't see it in the manpage, but the source code checks if the program is invoked as tcsh or not. If it is, the code sets the prompt as noted in the question: HIST = '!'; HISTSUB = '^'; PRCH = tcsh ? '>' : '%'; /* to replace %# in $prompt for normal users */ PRCHROOT = '#'; /* likewise for root */ word_chars = STR_WORD_CHARS; bslash_quote ...


0

Because repeat is a builtin command but not part of the syntax, you cannot use ()s in the argument list easily. Even with the Bourne Shell that is less limited than tcsh repeat -c 3 (echo a) will not work. What works is: (repeat -c 10 echo a) as this runs the whole command in a subshell. But even: (repeat -c 3 echo a; echo b) will repeat the echo ...


0

Another workaround would be to instead use ZSH. % repeat 3 (echo hi; echo there) hi there hi there hi there %


1

From tcsh(1): repeat count command The specified command, which is subject to the same restricā€ tions as the command in the one line if statement above, is executed count times. [..] And from the if documentation: if (expr) command [..] command must be a simple command, not an alias, a pipeline, a command list or ...



Top 50 recent answers are included