↧
Answer by Paul Elliott for Can command substitution be nested in variable...
On Linux, you can pipe into the source command:echo $(xclip -o -selection clipboard)/copi/knott|source /dev/stdinFor systems that do not have /dev/stdin, you would have to write toa temporary file,...
View ArticleAnswer by fozzybear for Can command substitution be nested in variable...
Here's an examplary hack, that bypasses assigning a temporary variable for chained parameter substitution:declare -a values=( "4: " "#1" "#2" "#3" "#4" )declare -A arr["VALUES"]="${values[@]}"echo -e...
View ArticleAnswer by mikeserv for Can command substitution be nested in variable...
Yeah, you can do that - kind of. It's really not pretty. It's more like in-line than nested. The problem is you have to operate on the value of the parameter you expand - if that parameter has no value...
View ArticleAnswer by cuonglm for Can command substitution be nested in variable...
No, you can't. bash and most other shells (except zsh) don't allow nested substitution.With zsh, you can do nested substitution:$ echo ${$(echo 123)/123/456} 456
View ArticleAnswer by John1024 for Can command substitution be nested in variable...
If you don't want to create a variable, then there are other ways to perform string substitution:$ echo "$(xclip -o -selection clipboard | sed 's/copi/knott/')"Here's a string I just knotted.
View ArticleCan command substitution be nested in variable substitution?
I would like to use variable substitution on a particular string that I access via a command. For example, if I copy something into my clipboard, I can access it like this.$ xclip -o -selection...
View Article
More Pages to Explore .....