The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 08:08 AM
Request to modify script to list multiple parameters for V_fieldid variable Sammy Shell Programming and Scripting 0 03-30-2008 08:08 PM
Modify Perl script to work with txt - Permissions script joangopan Shell Programming and Scripting 1 09-12-2007 11:38 PM
Modify FTP script to have SCP madhunk Shell Programming and Scripting 2 04-26-2006 03:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-09-2008
kingpmp kingpmp is offline
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!
  #2 (permalink)  
Old 09-09-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
What kind of package? What operating system? What is the '$1' that this script is writing the output to?
  #3 (permalink)  
Old 09-09-2008
kingpmp kingpmp is offline
Registered User
  
 

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

$1 is an implicit parameter passed into request script.
  #4 (permalink)  
Old 09-09-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
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?
  #5 (permalink)  
Old 09-09-2008
kingpmp kingpmp is offline
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.
  #6 (permalink)  
Old 09-09-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
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.
  #7 (permalink)  
Old 09-10-2008
kingpmp kingpmp is offline
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)
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0