![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 problem is, the package is still installed to the default BASEDIR - "/" rather than the above one. Any help will be appreciated! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
What kind of package? What operating system? What is the '$1' that this script is writing the output to?
|
|
#3
|
|||
|
|||
|
It's Solaris package.
$1 is an implicit parameter passed into request script. |
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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) |
|||
| Google The UNIX and Linux Forums |