Set VSX environment in /bin/sh scripts

One time a Unix demigod yelled at me in public because I was writing my shell script in bash instead of /bin/sh. You’d think I drew a comic strip of {can’t speak of this religious figure because it has incited wars}. I mean it was like religion. I’ve been damaged goods ever since. Now I write my scripts in sh just because I’m afraid he’ll be lurking around the corner.

So in VSX and maybe its a GAIA thing, if you write your scripts in /bin/sh, you’ll notice you can’t access ‘vsenv’. The reason is the profile didn’t execute the /etc/profile.d/vsenv.sh script that inserts VSX functions into your /bin/sh environment.

So your scripts need to include:

#!/bin/sh

./etc/profile.d/CP.sh

. /etc/profile.d/vsenv.sh

Forgive me for my sins,

dreez

Advertisements
Post a comment or leave a trackback: Trackback URL.

Comments

  • Peter  On June 25, 2014 at 4:41 am

    Hello, I’m experiencing strange behavior of iproute2 “/sbin/ip route show” works perfectly if called from a login shell, but it does not if called from my script, which sources CP.sh & vsenv.sh. Any CP util is working like a charm. Strange…

    • Dreezman  On June 25, 2014 at 4:54 am

      can you do a
      echo $PATH
      set
      alias

      and compare environments?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

blog.lachmann.org

Michael Endrizzi's - St. Paul MN - CheckPoint blog on topics related to Check Point products and security in general.

%d bloggers like this: