I know that nobody will mention it, so here I go. You can use printf
!
#!/bin/bash
CONFIG_OPTION="VENDOR_NAME"
CONFIG_VALUE="Default_Vendor"
printf -v "$CONFIG_OPTION" "%s" "$CONFIG_VALUE"
# Don't believe me?
echo "$VENDOR_NAME"
More Related Contents:
- How can I check if a directory exists in a Bash shell script?
- In the shell, what does ” 2>&1 ” mean?
- An efficient way to transpose a file in Bash
- Can I export a variable to the environment from a Bash script without sourcing it?
- Bash tool to get nth line from a file
- How can I split a large text file into smaller files with an equal number of lines?
- Which characters need to be escaped when using Bash?
- How to run the sftp command with a password from Bash script?
- “~/Desktop/test.txt: No such file or directory”
- How to merge two files line by line in Bash
- How to represent multiple conditions in a shell if statement?
- How to provide password to a command that prompts for one in bash?
- Delete files older than 10 days using shell script in Unix [duplicate]
- “Invalid Arithmetic Operator” when doing floating-point math in bash
- What do double-asterisk (**) wildcards mean?
- How does this bash fork bomb work? [duplicate]
- How do I pause my shell script for a second before continuing?
- Get the date (a day before current time) in Bash
- Reading filenames into an array
- Is there a way to make bash job control quiet?
- Hiding secret from command line parameter on Unix
- What does the double-asterisk (**) wildcard mean?
- Bash regex =~ operator
- Fastest possible grep
- Bash script to receive and repass quoted parameters
- Convert Unix timestamp to a date string
- File content into unix variable with newlines
- Using Bash to display a progress indicator (spinner) [duplicate]
- Extract version number from a string
- Left side of pipe is the subshell?