How to modify BASEDIR with request script?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to modify BASEDIR with request script?
# 1  
Old 09-09-2008
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. Smilie

Any help will be appreciated! Smilie
# 2  
Old 09-09-2008
What kind of package? What operating system? What is the '$1' that this script is writing the output to?
# 3  
Old 09-09-2008
It's Solaris package.

$1 is an implicit parameter passed into request script.
# 4  
Old 09-09-2008
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  
Old 09-09-2008
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  
Old 09-10-2008
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  
Old 09-10-2008
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)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request per second script

Hello; I'm having about 800 log files and i'm trying to write a script that report the counts of lines per second or "requests per second" in each log file and report the output which includes the timestamp for the highest lines per second count and the log file name and the highest number per... (5 Replies)
Discussion started by: Katkota
5 Replies

2. Shell Programming and Scripting

Extract root basedir name from a *.tar.gz file

I am working on a script to install a software distribution which ships as a *.tar.gz file. The company doesn't name the dist consistently, but the resulting directory out of the *.tar.gz file (ie: XXX_X_X_X) is consistent and shows the software version. I'm writing this with BASH-3.25.x... (4 Replies)
Discussion started by: forrie
4 Replies

3. Shell Programming and Scripting

how can I modify this script.

hello forum members, I have a script which is used find the Uname and passwords and redirects into a output.txt file.I hardcoded a string "ciadev" but iwant search two more strings also "absdev" and "absprod" So modify this script please. I am lookinmg forward from you, please find the below... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

4. Shell Programming and Scripting

Solaris request script

Hi, In the request script I need to read user input and store to variable to use it later in postinstall script. e.g. LOGDIR=/app/log echo "Please type the Log Directory : (current value: $LOGDIR)" read LOGDIR When asked, if the user enters a value the parameter is ok and I... (2 Replies)
Discussion started by: potro
2 Replies

5. Shell Programming and Scripting

lowercase basedir? get filename

Is there an equivalent of basedir in shell script? I have a file location and I want to lowercase just the filename not the path. (2 Replies)
Discussion started by: mainegate
2 Replies

6. Shell Programming and Scripting

Please help to modify my script

Hi, I have a script which connect to ATM's and pull two files from the ATM. The which i try to pull is like PIC20085200001*.JPG First 7 digit consist of year montn and date as well After todays execution i want to change the date to next date I add few lines in the script but it is not... (6 Replies)
Discussion started by: Renjesh
6 Replies

7. UNIX for Advanced & Expert Users

Using a request script

I am creating a package(Solaris10 on sparc) that needs user input. As I understand it, I need to use a request script. My problem is that the value I set in my request script is not visible in my postinstall script. Not sure if I am doing it right. Here is an example request script... (4 Replies)
Discussion started by: Tornado
4 Replies

8. Shell Programming and Scripting

Request to modify script to list multiple parameters for V_fieldid variable

I am posting a script below which essentially excutes the following functions in the described order. 1) From a source directory pools together three files generated by system logs for each user session, tar's these files and archives them as a log set in a destination directory and these... (0 Replies)
Discussion started by: Sammy
0 Replies

9. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies
Login or Register to Ask a Question