LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 08: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, 09:48 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
$'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



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 10:48 AM
Making grep find files containing '$' (the dollar sign char). stf92 Linux - Newbie 9 12-08-2010 11:16 AM
Removing a directory beginning with a minus sign. harry edwards Linux - General 4 03-01-2008 05:44 PM
The Value of a Dollar (PSA) taylor_venable General 3 03-23-2007 04:01 AM
sign on invisible in gaim - NOT invi after sign on saravkrish Linux - Software 7 09-12-2005 10:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:26 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
Open Source Consulting | Domain Registration