LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-19-2022, 03:07 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,614

Rep: Reputation: 180Reputation: 180
What does $ do at beginning of echo?


I'm trying to debug a script, not of my own authorship. There are several echo lines like like:
Code:
echo -n $"Starting OpenDKIM Milter... "

echo -n $"Stopping OpenDKIM Milter... "
What is the '$' at the front of the string supposed to do? I'm only familiar with its use as and enviroment variable, shell parameter or shell function designator. What does this contstruct do?
 
Old 05-19-2022, 04:38 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,160

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
From the bash man page

Code:
       A double-quoted string preceded by a dollar sign ($"string") will cause the string to be translated  ac‐
       cording  to  the  current  locale.   The  gettext infrastructure performs the message catalog lookup and
       translation, using the LC_MESSAGES and TEXTDOMAIN shell variables.  If the current locale is C or POSIX,
       or  if there are no translations available, the dollar sign is ignored.  If the string is translated and
       replaced, the replacement is double-quoted.
 
2 members found this post helpful.
Old 05-19-2022, 05:49 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,614

Original Poster
Rep: Reputation: 180Reputation: 180
Quote:
Originally Posted by smallpond View Post
From the bash man page

Code:
       A double-quoted string preceded by a dollar sign ($"string") will cause the string to be translated  ac‐
       cording  to  the  current  locale.   The  gettext infrastructure performs the message catalog lookup and
       translation, using the LC_MESSAGES and TEXTDOMAIN shell variables.  If the current locale is C or POSIX,
       or  if there are no translations available, the dollar sign is ignored.  If the string is translated and
       replaced, the replacement is double-quoted.
well, I learned something! Thanks. There is no locale info in the string, so nothing happened when I echoed it manually.
 
  


Reply

Tags
bash



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
echo text into the beginning of a specific line of a existing file RandyH9 Programming 3 04-13-2014 02:36 PM
echo 0:$(echo 8*35*37*47 | bc) | xxd -r && echo $(id -un) Linuxanity LinuxQuestions.org Member Intro 1 08-15-2012 06:30 PM
LXer: From the End of the Beginning to the Beginning of the End LXer Syndicated Linux News 0 03-08-2009 12:12 AM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 02:59 PM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:58 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