LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2016, 03:04 AM   #1
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

Rep: Reputation: 15
what is the meaning of $"${@// /\\ }"


Hi,
In spark service start shell script, below command is available.
Code:
ssh $SPARK_SSH_OPTS "$slave" $"${@// /\\ }" 2>&1 | sed "s/^/$slave: /" &

Here what is the meaning of
Code:
$"${@// /\\ }"
Please help me
 
Old 12-28-2016, 04:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
see man bash, that will help you to understand (but definitely not an easy case):
Code:
       A double-quoted string preceded by a dollar sign ($"string") will cause the string to be translated according to the current locale.  If
       the  current  locale  is  C  or POSIX, the dollar sign is ignored.  If the string is translated and replaced, the replacement is double-
       quoted.
From this part you will know it is ${@// /\\ } inside $"<string>". Next:
Code:
       ${parameter/pattern/string}
              Pattern substitution.  The pattern is expanded to produce a pattern just as in pathname expansion.  Parameter is expanded and the
              longest  match  of  pattern  against  its  value  is  replaced with string.  If pattern begins with /, all matches of pattern are
              replaced with string.  Normally only the first match is replaced.  If pattern begins with #, it must match at  the  beginning  of
              the  expanded  value  of  parameter.   If pattern begins with %, it must match at the end of the expanded value of parameter.  If
              string is null, matches of pattern are deleted and the / following pattern may be omitted.  If parameter is @ or *, the substitu‐
              tion  operation  is  applied  to  each positional parameter in turn, and the expansion is the resultant list.  If parameter is an
              array variable subscripted with @ or *, the substitution operation is applied to each member of the array in turn, and the expan‐
              sion is the resultant list.
here parameter is @, pattern begins with / and contains a single space, string is a backslash and a space, so actually it will add a backslash before all the spaces in $@.
see also:
Code:
   Special Parameters
      @      Expands to the positional parameters, starting from one.  When the expansion occurs within double quotes, each parameter  expands
              to  a  separate  word.   That  is,  "$@" is equivalent to "$1" "$2" ...  If the double-quoted expansion occurs within a word, the
              expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last  parameter
              is joined with the last part of the original word.  When there are no positional parameters, "$@" and $@ expand to nothing (i.e.,
              they are removed).
 
2 members found this post helpful.
Old 12-28-2016, 08:42 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
It is a secret voodoo curse. Be careful not to speak it out loud, or you will turn into a Windows user frog.
 
1 members found this post helpful.
Old 12-28-2016, 01:14 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I thought it was a picture of what happens when one of the crossbeams goes out of skew on the treadle, but perhaps that only happens in Python (Monty) programs.

(Those who are not fans of the Monty Python comedy series should not try to make sense of the above.)
 
  


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
what is meaning of "invq = inv_Q(prob)" in threshold.cc file in ns2 er.poojasahu@gmail.com Linux - Software 1 12-19-2013 07:19 PM
what is the meaning of "e" in "double freq = 914.0e6; // frequency" er.poojasahu@gmail.com Linux - Wireless Networking 3 12-17-2013 01:57 AM
What is meaning of "has pages locked into memory (for real-time and custom IO) " ? dtustudy68 Programming 2 05-13-2011 01:08 PM
What is the meaning of using "__KERNEL__" and "MODULE" macro? nithima Linux - Newbie 1 10-18-2010 08:26 PM
The meaning of "/dev/md0: No md super block found"? PhillipHuang Linux - Software 6 01-10-2007 07:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 PM.

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