Bash itself doesn’t understand variable names with dots in them, but that doesn’t mean you can’t have such a variable in your environment. Here’s an example of how to set it and get it all in one:
env 'agent1.ip=192.168.100.137' bash -c 'env | grep ^agent1\\.ip= | cut -d= -f2-'
More Related Contents:
- Reading quoted/escaped arguments correctly from a string
- Can a shell script set environment variables of the calling shell? [duplicate]
- What is the cleanest way to ssh and run multiple commands in Bash?
- How can I remove the extension of a filename in a shell script?
- How to avoid heredoc expanding variables? [duplicate]
- Bash script – store stderr in a variable [duplicate]
- How can I count all the lines of code in a directory recursively?
- How does Ctrl-C terminate a child process?
- Running multiple commands in one line in shell
- Specify other flags in awk script header
- echo that outputs to stderr
- Bash if statement with multiple conditions throws an error
- Variable variable assignment error -“command not found”
- Concatenating multiple text files into a single file in Bash
- How to Batch Rename Files in a macOS Terminal?
- How to pass arguments to Shell Script through docker run
- Simulate user input in bash script [closed]
- Print a character repeatedly in bash [duplicate]
- Forking / Multi-Threaded Processes | Bash
- BASH Syntax error near unexpected token ‘done’ [duplicate]
- Why is #!/usr/bin/env bash superior to #!/bin/bash?
- Why variable values are lost after terminating the loop in bash? [duplicate]
- Convert line endings [duplicate]
- How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?
- How does one change the language of the command line interface of Git?
- Reading null delimited strings through a Bash loop
- Using grep to search for hex strings in a file
- How can I execute a bash function using sudo?
- BASH: Writing a Script to Recursively Travel a Directory of N Levels
- How to parse a string with multiple characters to split on-Bash Scripting