I have tried ...
With and without double quotes "" and __
eval "VAR=$Cat1 $Gr3p0 $Node $Output1"
I am running several eval grep-ing for various info and what I want to do is format the outputs and comma separate or use pipes and import it into excel.
so sometime like this after I get the eval --> $VAR
cat $VAR1 || $VAR2 || $VAR3 || >> results.txt .... then pull it into a .xls
If I understand correctly you don't need eval/variable and you don't need cat at all. Search your shell man pages for command substitution. You just need to format and spool the output (using printf, for example).
Thanks, but these commands I am buiding seem to require eval, due to whittespace and | symbols ect. the cat was only an example to show what I wanted to do with the formating, what I really need to know is how do take the output from my eval(command) and make it a variable like ---
eval(VAR1="$Cat1 $Gr3p0 $Serial $Output1")
but I can't get the syntex correct and I can't find a good example, I know it can be done and once I have that, the rest is cake!
once I get this, i will create a readable , maintainable spreadsheet, with all of my server info
example: hostname || IP || firmware || OS ver. || Memory || etc.
Oh, right. But that's the result of redirecting the output. If you want the result of the command to be both written to a file and printed to the standard output, use 'tee' command.
I ran a prtconf statement and wrote it out to /dfezz/tmp.txt then I cat and grep for what I need, the other way I was doing it was running that cmd several times.