Customizing the prompt in csh/tcsh

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to customize the prompt in tcsh shell.
for instance say if I were at a directory which is 7 levels deep from the home/user, the prompt displays as below
home/user/L1/L2/L3/L4/L5/L6/L7 >



but I want the prompt to be like this (home/user and the last two directories only )
home/user/.../L6/L7 >







share|improve this question






















  • FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
    – cas
    Jan 22 at 3:41











  • Hi Craig Thank yo so much for the info.
    – Venkatanathan Ramamurthi
    Jan 22 at 3:55










  • You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
    – steeldriver
    Jan 22 at 17:09










  • @steeldriver thanks man
    – Venkatanathan Ramamurthi
    Jan 23 at 6:29














up vote
0
down vote

favorite












I'm trying to customize the prompt in tcsh shell.
for instance say if I were at a directory which is 7 levels deep from the home/user, the prompt displays as below
home/user/L1/L2/L3/L4/L5/L6/L7 >



but I want the prompt to be like this (home/user and the last two directories only )
home/user/.../L6/L7 >







share|improve this question






















  • FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
    – cas
    Jan 22 at 3:41











  • Hi Craig Thank yo so much for the info.
    – Venkatanathan Ramamurthi
    Jan 22 at 3:55










  • You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
    – steeldriver
    Jan 22 at 17:09










  • @steeldriver thanks man
    – Venkatanathan Ramamurthi
    Jan 23 at 6:29












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to customize the prompt in tcsh shell.
for instance say if I were at a directory which is 7 levels deep from the home/user, the prompt displays as below
home/user/L1/L2/L3/L4/L5/L6/L7 >



but I want the prompt to be like this (home/user and the last two directories only )
home/user/.../L6/L7 >







share|improve this question














I'm trying to customize the prompt in tcsh shell.
for instance say if I were at a directory which is 7 levels deep from the home/user, the prompt displays as below
home/user/L1/L2/L3/L4/L5/L6/L7 >



but I want the prompt to be like this (home/user and the last two directories only )
home/user/.../L6/L7 >









share|improve this question













share|improve this question




share|improve this question








edited Aug 21 at 0:52









Rui F Ribeiro

35.2k1270113




35.2k1270113










asked Jan 22 at 3:26









Venkatanathan Ramamurthi

1




1











  • FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
    – cas
    Jan 22 at 3:41











  • Hi Craig Thank yo so much for the info.
    – Venkatanathan Ramamurthi
    Jan 22 at 3:55










  • You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
    – steeldriver
    Jan 22 at 17:09










  • @steeldriver thanks man
    – Venkatanathan Ramamurthi
    Jan 23 at 6:29
















  • FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
    – cas
    Jan 22 at 3:41











  • Hi Craig Thank yo so much for the info.
    – Venkatanathan Ramamurthi
    Jan 22 at 3:55










  • You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
    – steeldriver
    Jan 22 at 17:09










  • @steeldriver thanks man
    – Venkatanathan Ramamurthi
    Jan 23 at 6:29















FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
– cas
Jan 22 at 3:41





FYI csh/tcsh is a terrible shell for interactive use, and even worse for programming. See CSH PROGRAMMING CONSIDERED HARMFUL (note: tcsh fixes some but not all of the bugs of csh, but still has the same design flaws). It is highly recommended to use bash, ksh, or zsh instead...and limit your scripts to using only POSIX sh features if you want to write portable scripts.
– cas
Jan 22 at 3:41













Hi Craig Thank yo so much for the info.
– Venkatanathan Ramamurthi
Jan 22 at 3:55




Hi Craig Thank yo so much for the info.
– Venkatanathan Ramamurthi
Jan 22 at 3:55












You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
– steeldriver
Jan 22 at 17:09




You can limit the expansion of the CWD to n trailing directories by replacing ~ by c0n or C0n in your prompt - but I don't know a way to trim intermediate directories in the way you are asking. See for example Customizing your shell prompt
– steeldriver
Jan 22 at 17:09












@steeldriver thanks man
– Venkatanathan Ramamurthi
Jan 23 at 6:29




@steeldriver thanks man
– Venkatanathan Ramamurthi
Jan 23 at 6:29















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418739%2fcustomizing-the-prompt-in-csh-tcsh%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418739%2fcustomizing-the-prompt-in-csh-tcsh%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?