How To Preserve Quotes In Bash Arguments

If you want to preserve quoting to pass shell arguments to a called command, use the four characters “$@” (including the double quotes) instead of the two characters $*
![]() |
If you want to preserve quoting to pass shell arguments to a called command, use the four characters “$@” (including the double quotes) instead of the two characters $*
There are three commands in Linux to easily get a reverse DNS lookup with: dig, host and nslookup. Here are examples of each: shell> dig -x 3.214.2.238 +short
1 |
ns3.wyzaerd.info. |
shell> dig -x 3.214.2.238
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.86.amzn1 <<>> -x 3.214.2.238 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19300 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;238.2.214.3.in-addr.arpa. IN PTR ;; ANSWER SECTION: 238.2.214.3.in-addr.arpa. 300 IN PTR ns3.wyzaerd.info. ;; Query time: 8 msec ;; SERVER: 10.0.0.2#53(10.0.0.2) ;; WHEN: Wed Sep 1 19:43:56 2021 ;; MSG SIZE rcvd: 72 |
shell> host 3.214.2.238
1 |
238.2.214.3.in-addr.arpa domain name pointer ns3.wyzaerd.info. |
shell> nslookup 3.214.2.238
1 2 3 4 5 |
Server: 10.0.0.2 Address: 10.0.0.2#53 Non-authoritative answer: 238.2.214.3.in-addr.arpa name = ns3.wyzaerd.info. |
I was getting error “You must specify a region” when running any aws CLI command. The fix: Using the aws command:
1 |
aws configure set region us-east-1 --profile demo |
which will automatically add the following to the file ~/.aws/config:
1 2 |
[profile demo] region = us-east-1 |
You many simply edit the ~/.aws/config file yourself and append the same thing:
1 2 3 4 |
vi ~/.aws/config [profile demo] region = us-east-1 |
Solution: “Double Quote” your variables!
1 2 3 4 5 6 7 8 9 10 11 |
shell> myvar="abc def ghi" shell> echo $myvar abc def ghi shell> echo "$myvar" abc def ghi |
See Also: https://stackoverflow.com/questions/22101778/how-to-preserve-line-breaks-when-storing-command-output-to-a-variable
Problem While running the aws cli command from a Perl async command inside apid, I go the following error:
1 |
IOError: [Errno 10] No child processes |
Solution The issue turned out to be a bug in Python2.7, so I upgraded to Python3.4, then uninstalled and re-installed the aws cli software so that it used the proper Python34 version. Procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
sudo -i cd ## Upgrade Python yum install python34 alternatives --config python ## "Uninstall" old aws cli mv /opt/aws /opt/aws.fcs cd /usr/bin/ mv aws aws.fcs mv aws_completer aws_completer.fcs ## Install new aws cli curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip ./aws/install -i /opt/aws -b /usr/bin /usr/bin/aws --version |
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html […]
Recently, I wanted to see the “origin” of the git repository I was working in. The command is: git remote -v For example:
1 2 3 |
theUser@theHost$ git remote -v origin git@localhost:/volumes/data/git/thePlugin.git (fetch) origin git@localhost:/volumes/data/git/thePlugin.git (push) |
Zero-Downtime Cluster Maintenance: Comparing the Procedures for Upgrades versus DB/OS Maintenance
How to move the Relay role to another node in a Composite Tungsten Cluster
Tungsten Clustering provides high availability, disaster recovery, and a host of other benefits for MySQL / MariaDB / Percona Server databases. In this blog post we will explore some of the shell aliases I use every day to administer various Tungsten Clusters.
There are many things to configure in Nagios, especially when using custom check commands. Recently I needed to configure all of the Continuent Clustering Nagios checks. Once setup on the database side, I wanted to confirm that everything was working. Basics: Run a Remote NRPE Check To test a remote NRPE client command from a […]