General TC > Programming & Scripting - Unofficial
[Solved] variable expansion inside a here-file issue
jazzbiker:
--- Quote from: GNUser on July 17, 2023, 10:21:37 AM ---Hi, Andrey. Thanks for making me laugh ;D
What I like best about GNU/Linux is that there are no "Keep Out" signs anywhere. Other OSes seem not to have grim doors and crawling things--but that's only because the user is not allowed to look around.
--- End quote ---
Hi Bruno,
I like You validate my jokes about shell ) But, seriously, I'm scared with it ( It doesn't play fairly. Still probably this is my personal attitude, I wrote a lot in various assemblers so You can believe me I am quite comfortable without any doors and even walls at all ) Nice that You keep calm and happy using shell! Hope we will appeal to You as the last resort when the next time shell will put the gun to the head of the next innocent programmer threatening to push the trigger. Damn, I am frightening myself. Time to stop )
jazzbiker:
--- Quote from: GNUser on July 17, 2023, 11:07:37 AM ---I would try 1000 other approaches before considering a nested here document. I don't like pain.
--- End quote ---
Well, this is said by man who enjoy shell! Worth believing.
jazzbiker:
--- Quote from: patrikg on July 17, 2023, 10:36:00 AM ---Yes I am familer with this type of word and there meaning.
Okey I get it, I think.
--- End quote ---
The trouble occurs because inside the here-file fragment assignments are not performed, while variables expansion takes place. Inside the here-file the text is simply text, not the source. Try to examine aus9's script from this point of view.
Navigation
[0] Message Index
[*] Previous page
Go to full version