Sponsored Content
Top Forums UNIX for Dummies Questions & Answers display full unix path as part of the command line Post 302092545 by reborg on Tuesday 10th of October 2006 02:58:25 PM
Old 10-10-2006
csh does not dealt with prompts in the same way as a bourne based shell.

There are two way to set this in a csh/tcsh shell.


in csh you would have to do something like this in your .cshrc
Code:
alias precommand 'set prompt="${cwd} >"'
precommand           # to set the initial prompt
alias cd 'chdir \!* && precommand'

gives:
/var/tmp/templog >



In tcsh you would add %/ to the prompt options for example:
Code:
set prompt="%m{%n} %/ >"

would give:

myhost{reborg} /var/tmp/templog >
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How Can I Display Unix Path All The Time

How Can I Display Unix Path All The Time currently my profile look like this # @(#)local.profile 1.8 99/03/26 SMI stty istrip PATH=/usr/bin:/usr/ucb:/etc:. export PATH # If possible, start the windows system # if ; then if then if ; then ... (1 Reply)
Discussion started by: murli1200
1 Replies

2. UNIX for Dummies Questions & Answers

explain how Can I Display Unix Path All The Time

How Can I Display Unix Path All The Time currently my profile look like this # @(#)local.profile 1.8 99/03/26 SMI stty istrip PATH=/usr/bin:/usr/ucb:/etc:. export PATH # If possible, start the windows system # if ; then if then if ; then OPENWINHOME=/usr/openwin export... (1 Reply)
Discussion started by: murli1200
1 Replies

3. UNIX for Dummies Questions & Answers

full path of .profile in unix

need a help, am a newbe in unix how do i locate the full path of the .profile where the environmental variable for a user is set. thanks (6 Replies)
Discussion started by: dba
6 Replies

4. Red Hat

ls command to give full path to files

How can i perform a ls or other command to list the full paths of files from a ls? Looked through the man page for ls, no luck $ cd /tmp/ $ ls -l total 6 drwx------ 2 root root 4096 Nov 7 2008 keyring-7b5rMv drwx------ 2 bcr bcr 4096 Dec 7 2007 keyring-cGhir8 $ I'd be looking for... (1 Reply)
Discussion started by: brendan76
1 Replies

5. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

6. Shell Programming and Scripting

How to extract strings from full path when full path is not fixed

/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies

7. Shell Programming and Scripting

Perl command to replace path part of variable

I'm trying to replace path which is part of variable inside script file: FROM: ABC_HOME=$ABC_ROOT/abc/1.0 TO: ABC_HOME=$ABC_ROOT/abc/1.5 I'm using this: perl -pi -e 's\ABC_HOME=$ABC_ROOT/abc/1.0\ABC_HOME=$ABC_ROOT/abc/1.5\g' /apps/scripts/test.sh This command is not working because... (2 Replies)
Discussion started by: djanu
2 Replies

8. UNIX for Advanced & Expert Users

how to fetch part of a line and display

Input of data: Student: Hari Roll No: 24777 Phone No: 122334 Student: Sudha Roll No: 247911 Phone No: 34552111 Student: Lata Roll No: 247790 Phone No: 7675656554 Student: Kutty Roll No: 24677 Phone No: 12442334 Student: Sudhar Roll No: 247411 Phone No: 3455244111 ... (4 Replies)
Discussion started by: rampriya.s
4 Replies

9. UNIX for Dummies Questions & Answers

Display full command (including options) information in running

Suppose I am a Unix user, not a root. I can see all commands in running by ps -elf, or some similar commands. Such commands may be submit by other Unix users. Is there a way that I can display those commands with their full parameters/options. For example, I can see a user is running "ls"... (3 Replies)
Discussion started by: happy_lotus
3 Replies

10. Shell Programming and Scripting

To display the selected part in text file of unix

0400903071220312 20120322 20:21 1TRANTELSTRAFLEXCAB22032012CMP201323930000812201108875802100A003485363 12122011AUS 182644 000C2 8122011 0000 000 1TRANTELSTRAFLEXCAB22032012CMP201323930000812201108875802100A003485363 12122011AUS ... (6 Replies)
Discussion started by: rammm
6 Replies
RESIZE(1)						      General Commands Manual							 RESIZE(1)

NAME
resize - set TERMCAP and terminal settings to current xterm window size SYNOPSIS
resize [ -u | -c ] [ -s [ row col ] ] DESCRIPTION
Resize prints a shell command for setting the TERM and TERMCAP environment variables to indicate the current size of xterm window from which the command is run. For this output to take effect, resize must either be evaluated as part of the command line (usually done with a shell alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the follow- ing alias could be defined in the user's .cshrc: % alias rs 'set noglob; eval `resize`' After resizing the window, the user would type: % rs Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a tempo- rary file and then read it back in with the "." command: $ resize > /tmp/out $ . /tmp/out OPTIONS
The following options may be used with resize: -u This option indicates that Bourne shell commands should be generated even if the user's current shell isn't /bin/sh. -c This option indicates that C shell commands should be generated even if the user's current shell isn't /bin/csh. -s [rows columns] This option indicates that Sun console escape sequences will be used instead of the VT100-style xterm escape codes. If rows and columns are given, resize will ask the xterm to resize itself. However, the window manager may choose to disallow the change. Note that the Sun console escape sequences are recognized by XFree86 xterm and by dtterm. The resize program may be installed as sunsize, which causes makes it assume the -s option. The rows and columns arguments must appear last; though they are normally associated with the -s option, they are parsed sepa- rately. FILES
/etc/termcap for the base termcap entry to modify. ~/.cshrc user's alias for the command. SEE ALSO
csh(1), tset(1), xterm(1) AUTHORS
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley) Copyright (c) 1984, 1985 by X Consortium See X() for a complete copyright notice. X Window System RESIZE(1)
All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy