Command prompt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Command prompt
# 1  
Old 12-03-2015
Command prompt

Hi All,

Even changing .bash_profile, i am getting only
Code:
$

as command prompt.

My bash profile looks like this.

Code:
PS1="[\d \t \u@\h:\w ] $ "

stty columns 200
set -o vi


if i run
Code:
bash

command and run
Code:
PS1="[\d \t \u@\h:\w ] $ "

then it is working as expected.

Code:
$ bash
bash-4.1$ PS1="[\d \t \u@\h:\w ] $ "
[Thu Dec 03 01:58:57 tibdata@qabox:~ ] $


Could you please help me how to resolve this issue by putting in .bash_profile?
# 2  
Old 12-03-2015
Hello akshu.agni,

There is a Thumb Rule for editing .profile which is: If we are editing a .profile each time we should log out and login again to server/box, could you please let us know if you have done so.


Thanks,
R. Singh
# 3  
Old 12-03-2015
Thanks for your reply.

Yup, done that, but no luck
# 4  
Old 12-03-2015
Hello akshu,

PS1 is usually set in .bashrc, not .bash_profile. .profile type files are for setting environment variables. PS1 is a shell variable, not an environment variable. Chances are, you have a .bashrc that is also setting PS1, could you please try to set it in .bashrc and let me know how it goes.


Thanks,
R. Singh
# 5  
Old 12-03-2015
Hi,

I noticed it was logging into korn shell, that is why .bash_profile wasn't working.

Now new command in .bash_profile is

Code:
PS1="${HOSTNAME}:\${PWD##*/} \$ "


Now working as expected.

I will contact my unix team to change default login to bash shell.

Thank you very much for your help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

2. SCO

Booting to Command Prompt

Hello, I need help booting to a command prompt. The server runs SCO Openserver 5.0, with a point of sale program that automatically boots upon startup. I can't gain root access, and the administrator password for the point of sale program is un-obtainable. I am upgrading to a new point of sale... (8 Replies)
Discussion started by: tedcurvin
8 Replies

3. UNIX for Dummies Questions & Answers

Execution of command at command prompt

Hello Experts, I am still learning linux and have come across a question, hope to get some answer. I have two servers, and both have the same version of svn client installed and both have the same user_id. my SVN client version: svn, version 1.6.11 (r934486) compiled Mar 2 2011,... (4 Replies)
Discussion started by: babyPen1985
4 Replies

4. UNIX Desktop Questions & Answers

hostname in command prompt

Hello, all. Running 11.04. Is there a way that, in an ssh or telnet session, that hostname will not appear in the command prompt? Not logged in yet, so not seeking a user shell environment. I just want to see something like 'login>', not 'ubuntu login>'. ---------- Post updated at 07:50 PM... (3 Replies)
Discussion started by: mfearer
3 Replies

5. UNIX for Advanced & Expert Users

autosys command(autorep) from command prompt

Hi, I am using AUTOSYS GUI based tool. But I want to get the job status from the UNIX command prompt. 1. I want to execute only autorep command in the UNIX command prompt. If need to execute this command what are the settings need to do that. 2. Is it possible for executing this... (5 Replies)
Discussion started by: onesuri
5 Replies

6. Shell Programming and Scripting

Telnet in command prompt

Hi, i have typed telnet yahoo.com 80 in command prompt it displays as a blank command prompt page titling as Telnet Yahoo.com Other than that i am not able to get anything. can anyone sort me out the reason for this (12 Replies)
Discussion started by: satheeshkr_cse
12 Replies

7. Windows & DOS: Issues & Discussions

Command Prompt

Hi does anyone know know how to find out the password on a vista pc using command prompt /cmd not change it (1 Reply)
Discussion started by: popo123456789
1 Replies

8. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

9. Shell Programming and Scripting

Command prompt argument

I am beginner to UNIX, I want to write shell script for find greatest of three numbers through command prompt. I have written similar code for converting lowercase to uppercase in command prompt. I am not getting logica how to implement greatest of three numbers through command prompt. (2 Replies)
Discussion started by: giridher2000
2 Replies

10. Shell Programming and Scripting

Command prompt from within a script?

I am writing a menu script and one of the options is to access a Command Prompt and return to the menu via CTRL-D. I have tried using a loop and echoing the PS1 value, then using read to assign whatever is entered into a variable, then executing the value of that variable as a command using .... (1 Reply)
Discussion started by: sanitywonko
1 Replies
Login or Register to Ask a Question