5 Replies Latest reply on Jul 12, 2012 3:53 PM by qing.fan

    list of environment variables

    qing.fan

      Hi everyone,

       

      I am using Caliber Interactive to get the list of environment variables. However I am looking for batch mode way to get the list. Is it already supported? How to use it?

       

      Thanks,

      Qing

        • 1. Re: list of environment variables
          chris_balcom

          Hi Qing,

           

          Are you thinking of listing the current state of just the environment variables that are referenced by the rule file, or were you thnking of all variables that exist in the environment regardless of their use in the rule file?

           

          For the first one we might investigate to see if there is a Calibre specific way to do it.

           

          For the second, we might consider using a unix/Linux shell capability.

          • 2. Re: list of environment variables
            qing.fan

            Hi Chris,

             

            Thanks for your quick reply. I am looking for the environment variables referenced in the rule file only. - just like the table I get through Calibre Interactive. Is it possible?

             

            Tahnks,
            Qing

            • 3. Re: list of environment variables
              chris_balcom

              This works for me in a small test on my own rule file. Interested to see if it works for you too:

               

               

              % cat freeze.txt

              file rules.env

              freeze env

               

              % $MGC_HOME/bin/calibre -svrf rules < freeze.txt > log.svrf.freeze ; grep "^#PRAGMA ENV" rules.env

              • 4. Re: list of environment variables
                chris_balcom

                hmmm... maybe a bit of bad news... I've been testing that more extensively and I found there is a glitch when the environment variables aren't actually defined. In other words, if all the environment variables are defined in the shell then the process I described should work, but if any of the environment variables used by the rule file aren't actually defined (or if they are empty) then the technique I described doesn't work.

                • 5. Re: list of environment variables
                  qing.fan

                  Hi Chris,

                   

                  I tried with it. However, I didn't get any result from grep as well. If it is too complicated, don't waste too much time, I can just write a script to do it.

                   

                  Thanks,

                  Qing