Skip to content

Instantly share code, notes, and snippets.

View lpiot's full-sized avatar
🏢
Working from office

Ludovic Piot lpiot

🏢
Working from office
View GitHub Profile
@lpiot
lpiot / shell_tips-and-tricks.sh
Last active April 30, 2020 09:52
SHELL - How-to convert a string with line breaks into a file
# source: https://stackoverflow.com/questions/52065016/how-to-replace-n-string-with-a-new-line-in-unix-bash-script
# Works everywhere
foo='1\n2\n3'; echo "${foo//'\n'/$'\n'}"
# With bash 4.4 and upper
foo='1\n2\n3'; echo "${foo@E}"

Keybase proof

I hereby claim:

  • I am lpiot on github.
  • I am obic (https://keybase.io/obic) on keybase.
  • I have a public key ASCI1hFXYLRGILi3cjRXQ1U3fpMFJ3aVDjz8u3K_E65HFAo

To claim this, I am signing this object: