Page 1 of 1

Interpreted Herdocs?

Posted: Sun 27 May 2018, 04:14
by s243a
I was wondering if I could put something like the following inside a heredoc:

Code: Select all

$(case $GCC_VERSION in 
   1); echo "id /var/lib/tazpkg/installed/gcc
             id /var/lib/tazpkg/installed/gcc-lib-base
             id /var/lib/tazpkg/installed/gcc-lib-math"; ;;;
   3); echo "id /var/lib/tazpkg/installed/gcc3"; ;;;
   49); echo "id /var/lib/tazpkg/installed/gcc49
              id /var/lib/tazpkg/installed/gcc49-lib-base"; ;;;
   54); echo "id /var/lib/tazpkg/installed/gcc54
              id /var/lib/tazpkg/installed/gcc54-lib-base"; ;;;
   64); echo "id /var/lib/tazpkg/installed/gcc54
              id /var/lib/tazpkg/installed/gcc54-lib-base"; ;;;
  )
so that I get a different string depending on the variable GCC_VERSION.

If your curious I'm working on a script to install the packages that I want for TazPup and hopefully to also build a devX (See Post)

Anyway, I'm going to give it a try and I'll report back on whether or not it works.

Posted: Mon 28 May 2018, 01:06
by technosaurus
This thread may be useful. It is designed for localization, but the same concepts apply.