hack setsite

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf hack setsite

  • Creator
    Topic
  • #52310
    Yves Guerin
    Participant

      Hello,

      I would like to modify the setsite program to do

      Code:

      cd $HCISITEDIR

      at the end of execution. But I do not know anything in perl.

      Any help will be great.

      Regards

      Yves

    Viewing 2 reply threads
    • Author
      Replies
      • #73748
        Rob Lindsey
        Participant

          What I find more use full on my Unix system are Aliases that I can just type in the word site and have it changed directories to the site directory or processes, which changes directories to $HCIROOTDIR//exec/processes/, there are times that I want to switch sites without ever going to the actual site directory.  That is why I use aliases.

          I am not sure if you are on NT or Unix (or variant there of) but from the Unix side of things, setsite is actually a KSH script which calls hcisetenv, which is actually the PERL code.  

          Now with all that being said , you can do the following line just before the exit 0; line in the program      hcisetevn.

          chdir $ENV{HCISITEDIR};

          I have not actually tried this but it should work.  Before you make that change I would make a backup copy of the program hcisetenv.

          Rob

        • #73749

          I agree, an alias would probably be the preferred method.

          What shell are you using?

          For csh/ksh, an alias could be like this, alias sst=’setsite testsite; cd $HCISITEDIR’

          -- Max Drown (Infor)

        • #73750
          Yves Guerin
          Participant

            Hello,

            Thank you for all of you for the help.

            We run aix (unix)

            1- I tried the chdir: not working

            2- I tried alias in .profile put I would like to do: “setsite siteX && cd siteX”

            My solution:

            1- I added in the .profile the following code (to tell ksh to source my new file-function)

            Code:

            . $FPATH/setsitecd


            2- I creaetd a file in $HCIROOT/kshlib ($FPATH): setsitecd

            3- I add the following code (function):

            Code:


            function setsitecd {
               eval `${CL_INSTALL_DIR}/integrator/sbin/hcisetenv -site ksh $*`

                   # modif yg pour faire un cd vers $HCSITEDIR
                   # verif si hcisetenv ok
                   if [ $? -eq 0 ] ; then
                           for param in $@ ;
                           do
                                   # verif si rep existe
                                   if [ -d $HCIROOT/$param ] ; then
                                           print “cd $HCIROOT/$param: O=Oui – N=Non > c”
                                           read reponse
                                           case $reponse in
                                                   O | o )
                                                           cd $HCIROOT/$param
                                                   ;;
                                           esac

                                   fi
                           done
                   fi
            }


            4- I did some tests and it works as expected.

            Thank you

            Yves

            😀

        Viewing 2 reply threads
        • The forum ‘Cloverleaf’ is closed to new topics and replies.