The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Please help to modify my script Renjesh Shell Programming and Scripting 6 05-21-2008 05:08 AM
Request to modify script to list multiple parameters for V_fieldid variable Sammy Shell Programming and Scripting 0 03-30-2008 05:08 PM
Modify Perl script to work with txt - Permissions script joangopan Shell Programming and Scripting 1 09-12-2007 08:38 PM
Modify FTP script to have SCP madhunk Shell Programming and Scripting 2 04-26-2006 12:35 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-09-2008
Registered User
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
Question How to modify BASEDIR with request script?

Here is request script:

Code:
#!/bin/sh
echo "Current install root path is [ $BASEDIR ]"
CONFIRM="n"
while [ "$CONFIRM" != "y" ]
do
        BASEDIR=""
        while true
        do
           echo please input install root path then press [ENTER]:
           read BASEDIR
           if [ ! -d "$BASEDIR" ]
           then
                 echo "$BASEDIR is not a valid path"
           else
              break
           fi
        done
        echo "Are you sure to change install root path to [ $BASEDIR ]? (y/n)"
        read CONFIRM
done
cat >$1 <<!
BASEDIR='$BASEDIR'
!
echo "Install root path is set to [ $BASEDIR ]"
exit 0
The request script is invoked and "BASEDIR" is set correctly. It can also be seen in postinstall script.

The problem is, the package is still installed to the default BASEDIR - "/" rather than the above one.

Any help will be appreciated!
Reply With Quote
Forum Sponsor
  #2  
Old 09-09-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 920
What kind of package? What operating system? What is the '$1' that this script is writing the output to?
Reply With Quote
  #3  
Old 09-09-2008
Registered User
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
It's Solaris package.

$1 is an implicit parameter passed into request script.
Reply With Quote
  #4  
Old 09-09-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 920
So... how is the Solaris pkgadd command going to know where you have set this new BASEDIR value? Are you passing it as a parameter on the pkgadd command-line somehow?
Reply With Quote
  #5  
Old 09-09-2008
Registered User
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
Noop....basically that's how UNIX works, you never know what's going on behind the scene.

BASEDIR is a default environment variable. It represents where the root install path, based on Sun document and my understanding.
Reply With Quote
  #6  
Old 09-09-2008
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 920
Well, if that's the case, how are you setting the environment variable? The script above just stores its value in the file specified by $1.
Reply With Quote
  #7  
Old 09-10-2008
Registered User
 

Join Date: Aug 2008
Location: Sydney - Australia
Posts: 8
Problem solved.

In file prototype, the path must be relative path rather than absolute path.

/path-1/path-2/... (x)

path-1/path-2/... (v)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0