substitution - Sourcing .profile from another script in ksh -


My .profile file has a RESLOC variable, which changes periodically. So I wrote a script, just take the input from the user on the new name.

cat tst.sh

  echo "Enter the location of the result where you would like your results go away." RLL Pearl-PI.BK-E "/ ([\ s] +) RESLOC = \ / result \ / ([\ S] +) / $ 1 RESLOC = \ / result \ / $ {RESL} / g" / reading For the / user / .profile cd / user /user/.profile "$ RESLOC" echo  

The last echo statement gives the output as a given value to the user. But when I have executed the script in the terminal, it displays the old value. Enter the result of $ / SP

  Enter the name of the place where you want your results to go. When the execution ends, when trying to display the RESLOC < / P> 
  $ RESLOC / user / release11     / pre> 

.profile file with update 12 has given. But it is not found properly. help please.

When you run tst.sh, a new shell process is generated and when it runs in your environment Ends back to the previous example of the shell, ie from which you ran tst.sh.

To modify the environment in your existing shell, you will need source tst.sh;

  Tst.sh  

This will run tst.sh in your current shell and will not generate a new shell process.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -