Artificial intelligent assistant

Command substitution: cat with executable content I have a file called `test` and the contents are: ubuntu@regina:~$ cat test ** test ** catting this file via command line works fine, but if I use command substitution I get an understandable but undesirable result. ubuntu@regina:~$ A=$(cat test) ubuntu@regina:~$ echo $A deployment detect.sh htpasswd.py logs test uwsgi-1.0.4 uwsgi-1.0.4.tar.gz test deployment detect.sh htpasswd.py logs test uwsgi-1.0.4 uwsgi-1.0.4.tar.gz Because of the asterisks that exist in the file `test` it basically executes an `echo *` and lists the directory contents along with the file contents. Is there a parameter I can pass to the command substitution syntax that will not provide this result, or is there another idiom that should be used for this?

You want to do `echo "$A"`. Wrapping the variable in the quotes makes it a string.

Example:


[root@talara test]# A=$( [root@talara test]# echo $A
FILE1 ham test test FILE1 ham test
[root@talara test]# echo "$A"
** test **

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8934c9f511a875b60e956af68c07a408