LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2011, 09:55 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Question zsh PS1, dollar sign in the beginning, why?


Here's the prompt for zsh:
Code:
PS1=$'%B%n @ %M%b %{\e[1;32m%}%~%{\e[0m%} $ '
Found somewhere that "$" before quotes. What does it do? Do I really need this "$" after "="?
 
Old 01-25-2011, 10:48 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
$'string' is a quoting pattern that will evaluate any baskslash-escaped characters it encloses into their literal equivalents. It's similar in function to echo -e (at least in bash, not sure about zsh), except that it can also be used in places other than just echoing text.

$'\t' evaluates to a literal tab character, for example.

I've located the zsh user guide section concerning it:
http://zsh.sourceforge.net/Guide/zshguide05.html#l115
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dollar sign in zsh Mr. Alex Linux - Newbie 3 01-24-2011 11:48 AM
Making grep find files containing '$' (the dollar sign char). stf92 Linux - Newbie 9 12-08-2010 12:16 PM
Removing a directory beginning with a minus sign. harry edwards Linux - General 4 03-01-2008 06:44 PM
The Value of a Dollar (PSA) taylor_venable General 3 03-23-2007 05:01 AM
sign on invisible in gaim - NOT invi after sign on saravkrish Linux - Software 7 09-12-2005 11:55 PM


All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration