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-30-2020, 01:00 PM   #1
Meerbi
LQ Newbie
 
Registered: Jan 2020
Posts: 2

Rep: Reputation: Disabled
Bash/Shell Script for CentOS7 - Need Help for escaping a special value


Hello,

Im currently working on an Bash Script for CentOS.

Code:
redCMD "~~ Enter Domain for Dashboard (e.g. monitor.domain.com):"
read monitordomainvalue
Code:
cat << EOF > docker-compose-traefik.yml
  .....

   - "traefik.http.routers.traefik.rule=Host(`$monitordomainvalue`)"
  .....

EOF
How do i escape the ` - Im getting an Synax Error because of this
I cant simply change the ` to " or ' because then the domain dont get recognized by Traefik.

Hope you can help me.
Regards
 
Old 01-30-2020, 01:06 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Code:
AA=$'`'
...
"traefik.http.routers.traefik.rule=Host(${AA}${monitordomainvalue}${AA})"
...
if I understand it well.
 
1 members found this post helpful.
Old 01-30-2020, 01:16 PM   #3
Meerbi
LQ Newbie
 
Registered: Jan 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
Code:
AA=$'`'
...
"traefik.http.routers.traefik.rule=Host(${AA}${monitordomainvalue}${AA})"
...
if I understand it well.
Worked! Thank you very much
 
Old 01-30-2020, 01:37 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
You are welcome
 
  


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
Any problem if I install CENTOS7 Workstation over CENTOS7 Server? Rich Strebendt Linux - Software 5 05-03-2018 11:05 PM
difference between value *value and value * value PoleStar Linux - Newbie 1 11-26-2010 03:37 PM
Automatic special character escaping in Bash scripts? wipe Linux - Software 1 06-05-2009 06:41 PM
escaping bash shell hectorDUQUE Fedora 5 03-15-2008 06:04 AM
Bash script - escaping whitespaces colabus Linux - Newbie 15 04-29-2006 11:58 PM

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

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