export PS1='"\[\033[1;34m\]\T \d | System_Analyst.\[\033[0m\]'


 
Thread Tools Search this Thread
Top Forums Programming export PS1='"\[\033[1;34m\]\T \d | System_Analyst.\[\033[0m\]'
# 1  
Old 11-30-2006
export PS1='\[\033[1;34m\]\T \d | System_Analyst.\[\033[0m\]'

Dear All,
I have a problem with export. I would like to show a prompt on my shell but as I receive the export environment variable pointer it is the string.
Like it is shown in the Title of this message
How I can get the result of that command after execution in a string I mean I would like to know if there is any system call or function which can return me the value in a string after execution of that string.







Thanks

Last edited by mobile01; 11-30-2006 at 11:31 AM.. Reason: typing mistake
# 2  
Old 11-30-2006
You don't have closed double quotes in what you show...

Code:
echo $PS1

will show you what PS1 currently is.
# 3  
Old 11-30-2006
Sorry but I wrote the following program

#include<stdlib.h>
main()
{
char *t=getenv("PS1");
printf("%s",t);
}

It gets the entry of environment variable and displays it. But I would like to have the execution result of that string.
# 4  
Old 11-30-2006
The export command you show is wrong. That is why you do not get an effect.
You have an extra " character at the beginning.
# 5  
Old 11-30-2006
Sorry again

That is a type mistake sir/mam. I am just getting the string stored over there.
# 6  
Old 11-30-2006
Let me put it another way
Code:
export PS1="HI there>"

Does that change your prompt to HI there> ?
If so, then start adding your escape codes. Plus, you can usually only use ANSI escape sequences. If your terminal is in VT100 emulation mode those esc[1< >m sequences will not necessarily bold/unbold the text in your prompt.
Try:
http://www.termsys.demon.co.uk/vtansi.htm
# 7  
Old 11-30-2006
Thank You

Thank You
Could you please clarify me more about the terminal types.
and if I am getting it as a string then how I can get the result of that like the colors.

I am getting the environment variable in a pointer to character and getenv is returning me that. So how it will be executed I mean how each time it is checked.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Export Glance "Global System Calls" data to a file

Hello... I'm trying to setup a cronjob to record system data using glance at certain times of the day. My question is, how would one export the "Global System Calls" information to a file? Below is the command I have been using and it works to export CPU information. glance -f ... (0 Replies)
Discussion started by: fumus
0 Replies

2. Shell Programming and Scripting

Custom PS1 "anamoly"

Hello: Any bash PS1 gurus in the house? I have a custom 2-line prompt and it displays fine, but there is an occasional anomaly. The backspace key sometimes takes out the 2nd line. Here's the relevant ~/.bashrc code: MKF='This is my Kung-Fu' DOS='C:${PWD//\//\\\}>' PS1="\$MKF\n\\" ... (0 Replies)
Discussion started by: Habitual
0 Replies

3. Shell Programming and Scripting

Command to view full data "export MAESTRO_OUTPUT_STYLE=LONG"

Hi, Always when I login to Unix, I need to give the following command to view the data properly; export MAESTRO_OUTPUT_STYLE=LONG The reason is that by default the settings export MAESTRO_OUTPUT_STYLE=SHORT Please let me know how I could make LONG as the default and avoid giving the... (1 Reply)
Discussion started by: jmathew99
1 Replies

4. Shell Programming and Scripting

Help with Export PS1 I think :-0

I am 100% new to Unix and trying to learn. This is my first time even touching a script in Unix. We have the following variable script that I am trying to run.... ################################## ###### variable test### ################################## Hostname=`hostname`... (3 Replies)
Discussion started by: LRoberts
3 Replies

5. Shell Programming and Scripting

"BOLD" printing a variable in PS1 command

I would like to "BOLD" print the hostname in the following statement: export PS1=$USER"@"$(hostname -s):'$PWD>' Is there a special character I can put before and after the variable to make it bold or blinking? Thanks. (4 Replies)
Discussion started by: pdtak
4 Replies
Login or Register to Ask a Question