Sponsored Content
Operating Systems Solaris Variable not expanding during Solaris pkgadd Post 302460340 by JerryHone on Thursday 7th of October 2010 07:50:59 AM
Old 10-07-2010
Variable not expanding during Solaris pkgadd

I'm having a little trouble with a Solaris package build/install.

I have the following entries in my prototype file...
Code:
# Interfaces file - all versions installed and auto linked to installation type...
f none $OPTDIR/config/interfaces.DEV                   0444 $OWNER $GROUP
f none $OPTDIR/config/interfaces.UA                    0444 $OWNER $GROUP
f none $OPTDIR/config/interfaces.PROD                  0444 $OWNER $GROUP

# Link interfaces to the correct installation type...
x none $OPTDIR                                          0755 $OWNER $GROUP
s none $OPTDIR/interfaces=config/interfaces.$PACKAGE_TYPE

PACKAGE_TYPE is determined by the request script at install time and takes a value of DEV, UA or PROD, so I then want to use that to link my interfaces file to the correct version during installation.

Unfortunately, after installation I get...
Code:
> ls -l interfaces
lrwxrwxrwx   1 root     root          31 Oct  6 12:53 interfaces -> config/interfaces.$PACKAGE_TYPE

From what I can tell in the manual, both source and target paths in a symbolic link entry should expand variables, so does anyone have any idea why mine isn't?

---------- Post updated 10-07-10 at 12:50 PM ---------- Previous update was 10-06-10 at 06:16 PM ----------

After much messing about, I've determined that this...
Code:
s none $OPTDIR/interfaces=config/$PACKAGE_TYPE

works but this
Code:
s none $OPTDIR/interfaces=config/interfaces.$PACKAGE_TYPE

doesn't.
It seems this is another example of where the Solaris install works in a shell-like manner but doesn't have full shell functionality.
My solution has been to perform the linking with a postinstall script which works fine. However, that creates an extra file that the original install doesn't know about, so pkgrm doesn't uninstall the package cleanly. To overcome that one, I've added the following to prototype
Code:
s none $OPTDIR/interfaces=dummy

to register a file ready for uninstall, although the postinstall has changed the link's target.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expanding shell variable

I have a question about expanding shell variables. Given the following piece of script: a="Some text" b="Other text" for i in a b do string1=$i echo $string1 --> returns 'a' string2=EXPRESSION_WITH_$i echo $string2 --> returns 'Some text' done ... (2 Replies)
Discussion started by: lonar
2 Replies

2. Solaris

pkgadd missing on Solaris 11

Hi, This is not a question thread, but rather a solution to an issue I have encountered on Solaris 11. It turns out that pkgadd is not available by default on Solaris 11. The solution is to install it with: pkg install SUNWpkgcmdsI hope this will save people some time. Cheers, ... (4 Replies)
Discussion started by: JVerstry
4 Replies

3. Shell Programming and Scripting

expanding alias from a variable

Hi ! I am making my first steps to make a script. Therefore i try to make a scp command more easier. Given is the following alias: 14='admin@x-abcd-def.xyz Now i want to let the script read three var's from the console to use them in the script and then build the scp string. echo... (7 Replies)
Discussion started by: locutus01
7 Replies

4. Solaris

pkgadd with admin fine (solaris 10)

Hi, I am trying to install a simple gcc package on a sparc (solaris 10) machine using the admin file (called admtest), but it is not working. I am getting the "Select package prompt". Can anyone have a look at it and tell me what am i doing wrong. # cat admtest mail=root... (5 Replies)
Discussion started by: Mack1982
5 Replies

5. Solaris

Solaris: Expanding / Extending a mount point / Slice

I'm new to UNIX, sort of inherited this job. I have an HP lefthand SAN, where I added 100GB to one of the volumes. As I understand I also have to expand the volume on the server (solaris 10 ) as well. So, how do I do that? The file system is called: sybdump. the mount point is /export/xxx/sybdump.... (19 Replies)
Discussion started by: Spaseman
19 Replies

6. Solaris

pkgadd will not install solaris studio 12.3

I downloaded Solaris 10 OS on x86, SVR4 installer to my desktop and ran digest -a md5 on the downloaded file and the hash values matched. I then ran bunzip2 followed by pkgadd -d SolarisStudio12.3-solaris-x86-pkg and am getting the following error: pkgadd: ERROR: attempt to process... (14 Replies)
Discussion started by: twk
14 Replies

7. Shell Programming and Scripting

Quick question on expanding variable

s=`awk '{ print $0}' /Applications/Relink.app/z_cloudline.txt` sed -n '"$s"' /var/mobile/Library/iFile/Bookmarks.plist > /var/mobile/originalip.txt What is the problem with that code ? With variable it only outputs: sed: -e expression #1, char 1: unknown command: `"' If I use the... (3 Replies)
Discussion started by: pasc
3 Replies

8. Shell Programming and Scripting

Expanding a globed variable name

Heyas I'm trying to give some information on used variables. While the first two work fine, the ones starting with a glob (is that the proper term?) fail. echo ${!TUI_*} ${!RET_*} ${!*_CLI} ${!*\_GUI} bash: ${!*_CLI}: bad substitution Same with @ or have them escaped. I found no... (2 Replies)
Discussion started by: sea
2 Replies

9. Solaris

Pkgadd failures with Solaris 11

I have some simple package installations that have worked in previous versions of Solaris just fine. I can install the packages, then install newer versions right over the top without error. In previous versions I had to specify the -G option during the installation in order for this to work. ... (0 Replies)
Discussion started by: moondog25
0 Replies

10. UNIX for Beginners Questions & Answers

Sed variable not expanding

I have also some difficulty calling sed to change a word in a file. sed -i 's/docTitl/Outline ${docTitl}/g' $ofln Moved to new thread, since it is a different question (3 Replies)
Discussion started by: Danette
3 Replies
install-solaris(1M)                                                                                                            install-solaris(1M)

NAME
install-solaris - install the Solaris operating system SYNOPSIS
install-solaris install-solaris invokes the Solaris Install program. Depending on graphical capability and available memory at the time of invocation, install-solaris invokes either a text-based installer or a graphical installer. The following minimum requirements for physical memory dictate which features are available during installation: For SPARC machines: 128 MB Minimum physical memory for all installation types 128 MB Minimum physical memory required for windowing system 384 MB Minimum physical memory required for graphical-based installation For x86 machines: 256 MB Minimum physical memory for all installation types 256 MB Minimum physical memory required for windowing system 512 MB Minimum physical memory required for graphical-based installation In some cases, even if the minimum physical memory is present, available virtual memory after system startup can limit the number of fea- tures available. install-solaris exists only on the Solaris installation media (CD or DVD) and should be invoked only from there. Refer to the for more details. install-solaris allows installation of the operating system onto any standalone system. install-solaris loads the software available on the installation media. Refer to the for disk space requirements. Refer to the for more information on the various menus and selections. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcdrom (Solaris instal- | | |lation media) | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ pkginfo(1), install(1M), pkgadd(1M), attributes(5) It is advisable to exit install-solaris by means of the exit options in the install-solaris menus. 23 Sep 2005 install-solaris(1M)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy