home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Escape $ Passing Variable to Second Script
Mindwatering Incorporated
Author: Tripp W Black
Created: 11/14/2023 at 11:40 AM
Category:
Linux
Other
Issue:
Have variable in BASH script.
example:
$myvar="textstringwith$sign"
If we escape it with single quotes or backslash it works to read into that first script correctly, but when passing to the second BASH script if fails.
If we double escape, then we nullify for the first script.
In other words, both of the tries below do not work:
$myvar = ''textstringwith$sign'' (this is two single quotes, not a double quote)
$myvar = "textstringwith\\$sign"
Solution:
Do one of each type of escape.
$myvar = 'textstringwith\$sign'
The first BASH script parse sees the variable as:
textstringwith\$sign
The second BASH script sees the passed variable as:
textstringwith$sign
previous page
×