4 ms·
Once I run into nested escape wrangling I start to seriously question how I'm trying to accomplish something.
by brazzledazzle 3y ago
Once I run into nested escape wrangling I start to seriously question how I'm trying to accomplish something.
- josephg 3y agoOnce I run into nested escape wrangling I seriously question the sanity of my tools.
- lanstin 3y agoIf I can't fix it in like 3 tries, I switch to my local shell script having the script to run on the remote end be in a HEREDOC and just scp it it over and then ssh exec it. Inside the HEREDOC, it's a sane environment.
- theK 3y agoCopying over the commands to run also has another added benefit, you have quite good documentation of what was run and when. Also it allows one to easily run a failing thing again (in case output gets mangled in the executing script)
- lanstin 3y agoAnd idempotency is essential for shell scripts that alter state. Otherwise you have to keep track of where failures happened.
- septune 3y agowrap it in base64 then cat it | ssh « base64 -d | bash »
- Arnavion 3y ago`printf '%q'` is your friend.