Reply
Thread Tools
daihard's Avatar
Posts: 68 | Thanked: 1 time | Joined on Aug 2007 @ Lynnwood, WA
#1
Hi.

I am trying to use my own command prompt for oss-xterm. As usually done, I created ~/.profile and included the following line:
Code:
PS1='[`hostname`:`pwd`]$ '
Since the hostname command returns "Nokia-N800-26" and the pwd command returns "/home/user", the prompt should look like this:
Code:
[Nokia-N800-26:/home/user]$
However, every time I invoke oss-xterm, the prompt shows up like this:
Code:
[`hostname`:`pwd`]$
Looks as if the commands aren't executed. The weird thing is, the hostname and pwd commands per se work just fine when invoked in oss-xterm. Only when embedded in ~/.profile do they have a problem.

Does anyone have a clue what I need to do to get this working?

TIA,
Dai
 
brendan's Avatar
Posts: 531 | Thanked: 79 times | Joined on Oct 2006 @ This side of insane, that side of genius
#2
try single quotes ('), not back quotes (`), as linux has a thing with proper encapsulation in quotes. variable and command expansion is done in single quotes, and back quotes treat the string literally.
__________________
Nokia n800
OS 2008
Pharos iGPS 360-BT
ElmScan 5 BlueTooth
BlackBerry Bold (9000)
AT&T Wireless
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#3
Remember the shell isn't bash either; it's busybox's ash.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
daihard's Avatar
Posts: 68 | Thanked: 1 time | Joined on Aug 2007 @ Lynnwood, WA
#4
Originally Posted by brendan View Post
try single quotes ('), not back quotes (`), as linux has a thing with proper encapsulation in quotes. variable and command expansion is done in single quotes, and back quotes treat the string literally.
Thanks for the reply.

I believe, however, but the command expansion is done by back quotes. The same syntax works just fine on my Fedora Core 6 box. In fact, the command works on the N800, too, if executed directly in the shell instead of from within a script. Go figure...
 
daihard's Avatar
Posts: 68 | Thanked: 1 time | Joined on Aug 2007 @ Lynnwood, WA
#5
Originally Posted by aflegg View Post
Remember the shell isn't bash either; it's busybox's ash.
Hi.

That's true. I first tried ~/.bashrc, to no avail, and then found that the shell wasn't bash. I felt lucky when I found ~/.profile processed until I ran into this problem.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#6
bash is available, I believe.

If not, it'd be trivial to port with mud.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
daihard's Avatar
Posts: 68 | Thanked: 1 time | Joined on Aug 2007 @ Lynnwood, WA
#7
Originally Posted by aflegg View Post
bash is available, I believe.

If not, it'd be trivial to port with mud.
Thanks for the info. I may give that a shot. At this moment, all I want is for the prompt to look the way I want it, not a full bash functionality.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:53.