Dobý den,
jsem student ZCU fakulty Strojní a potřeboval bych nainstalovat “CAD” NX9.0. Je oficiálně podporovaný pro RedHat a SuSe. Instalační skript, který potřebuji spustit je KornShell (ksh). Ten je potřeba lehce upravit, aby si při kontrole distribuce vzal mojí Fedoru 20. Jinak pokud skript nenajde RedHat, nebo SuSe, tak ukončí instalaci.
Tady je návod, jak upravit skript pro Ubuntu 12.04:
http://federicof89.altervista.org/varie/install_NX9_ubuntu12_04.html
Pokud Red Hat nahradím Fedora a cestu X11/app-defaults (na tuto /etc/X11/app-defaults)
#!/bin/ksh
# *****************************************************************************
# Copyright (c) 1989-2013
# Siemens Plm Software. All rights reserved
# RCS Info: ug_install,v V9.0 2013-04-16 19:08:22-07 Rcs rev: 9.13
# *****************************************************************************
# Title: ug_install
# Purpose: To install NX on Unix workstations.
# *****************************************************************************
# Rev History:
# 7.5.0.10 Ric Baxter 13MAR09 Initial NX 7.5 version taken from NX 7.0
# 7.5.0.12 Ric Baxter 13Apr09 Chng to Select_products to fix Linux 10 bug.
# 7.5.0.13 Ric Baxter 16Apr09 Chng to Mod_pvision_file
# 7.5.0.15 Ric Baxter 26May09 Change FNUM from 7 to 75.
# 7.5.0.30 Ric Baxter 08Feb10 Add support for Red Hat Linux.
# 7.5.0.30 Ric Baxter 10Feb10 Change Select & Deselect 'let' aritmetic logic.
# 7.5.0.30 Ric Baxter 10Feb10 Rm RC_DIR & RC_LNK_DIR logic & Start_ug function., tak to dopadne tímto způsobem:
# 7.5.0.30 Ric Baxter 10Feb10 Correction in Change_prod_dir.
# 7.5.0.31 Ric Baxter 18Feb10 Rework Linux Rev checking.
# 7.5.0.31 Ric Baxter 24Feb10 More Rework of Linux Rev checking.
# 7.5.0.32 Ric Baxter 08APR10 Final version. No changes.
# 8.0.0.08 Ric Baxter 22SEP10 Initial NX 8.0 version taken from NX 7.5
# 8.0.0.15 Ric Baxter 08FEB11 Beta version. No changes.
# 8.0.0.25 Ric Baxter 12JUL11 Final version. No changes.
# 8.5.0.06 Ric Baxter 08Nov11 Initial NX 8.5 version taktaktoen from NX 8.0
# 8.5.0.17 Ric Baxter 12Jun12 Rm NXJRE kit logic.
# 9.0.0.06 Ric Baxter 12Dec12 Initial version for 9.0.
# 9.0.0.08 Ric Baxter 11Feb13 Update to use SPLM_LICENSE_SERVER.
# 9.0.0.08 Ric Baxter 20Feb13 Chng Mod_env functions for ";"s in LICENSE var.
# 9.0.0.12 Ric Baxter 16Apr13 Chng logic to deduce FNUM from NX_VER.
# *****************************************************************************
# *****************************************************************************
# GLOBAL VARIABLES ************************************************************
# *****************************************************************************
# Unset any aliases to preclued colisions.
unalias $(alias | cut -d= -f1 | grep ^[0-z]) 2>&- # Add grep for AIX V160P18
print "initializing ...\c" # Put out a simple startup message.
CMD_LINE_ARGS=$* # Immediately save any cmd line args.
PRODNAME="NX" # The product this script installs.
# Version numbering.
NX_VER="9.0" # Alpha-numeric version w/dec point.
VNUM="0${NX_VER/./}" # 3 digit version num - no dec point.
# Figure out FNUM for file numbering. # 1 digit for X.0 VERs, 2 for X.1-9
FNUM=${NX_VER%.*} ; F2=${NX_VER#*.} # Split VER at dec point. set FNUM
[[ $F2 = *[1-9]* ]] && FNUM=$FNUM$F2 # If F2 is 1-9 append to FNUM.
SCRIPTNAME=`basename $0` # Script name without the directory.
SCRIPTDIR=$(cd $(dirname $0) ; pwd) # Get an absolute path to the script.
CWD=`pwd` # Preserve current directory name.
HOST=$(uname -n 2>&- || hostname 2>&-) # Try 'hostname' if uname -n fails.
NULL=/dev/null # Global for Linux cuz cant use 1>&-
# Standardized text message and screen variables.
NOTE="\n NOTE: " ; ERR="\naERROR: " ; WARN="\naWARNING: "
MSG="\n " ; QUE="\n* " ; TAB=" "
FILL_TXT="______________________________________" # Forms inter-field filler.
REENTER=" *****> " # Forms re-enter flag.
SELECTED="-->" # Product selected flag
UNSELECTED="no" # Product unselected flag
# Set machine dependant variables.
MACHINE=`uname` # Save machine var. for future use.
REV=`uname -r` # Save the revision of the OS.
case $MACHINE in
Linux) # Machine type is Linux
# Find out what flavor of Linux were running on. Added NX075P30
if $( grep -i "SuSE " /proc/version 1>$NULL 2>&1) ; then # Its SuSE.
#
MIN_REV=10 # Minimum SuSE version.
RELEASE_FILE=/etc/SuSE-release # Path to the release info file.
#
# Check the rev level by reading VERSION out of the release file.
if SUSE_REV=$(grep -i VERSION $RELEASE_FILE 2>$NULL) ; then
# Edit out anything but numbers.
# SUSE_REV=$(echo $SUSE_REV | sed 's![A-Z,a-z,=,-,., ]!!g')
# Translate out anything BUT digits, we just want the number(s).
SUSE_REV=$(echo $SUSE_REV | tr -cd [:digit:] )
# Check for the minimum rev.
[ "$SUSE_REV" -lt $MIN_REV ] && { # Must be at least MIN_REV.
print "${WARN}Unsupported Linux version: SuSE $SUSE_REV.
\r\t The $PRODNAME $NX_VER required minimum is: SuSE ${MIN_REV}." >&2
sleep 3
}
else # Couldnt find the file or couldnt get the version num.
print "${WARN}Unable to determine SuSE Linux version.
\r\t Could not find SuSE release file: $RELEASE_FILE
\r\t or, could not get SuSE version number from file.
\r\t The minimum required version is: SuSE ${MIN_REV}.
\r\t $PRODNAME $NX_VER MAY not run on this machine. " >&2
sleep 3
fi
#
# Now find X11/app-defaults dir. It moved so check two known places.
[ -d /usr/share/X11/app-defaults ] && { # Ck New location.
X11_DEFS_DIR=/usr/share/X11/app-defaults ;}
: ${X11_DEFS_DIR:=/usr/lib/X11/app-defaults} # Default to old location.
#
elif $( grep -i "Fedora " /proc/version 1>$NULL 2>&1) ; then # Its Red Hat.
# Not much to do here, just set X11_DEFS_DIR.
X11_DEFS_DIR=/etc/X11/app-defaults # X11 app-defaults dir.
else # Couldnt detect SuSE or Red Hat so give unsuppored message and quit.
print "${ERR} Unrecognized or unsupported Linux." >&2
X11_DEFS_DIR=`find / -type d -name app-defaults 2>/dev/null | grep "X11/app-defaults"`
fi
#
PATH=.:/sbin:/usr/sbin:/usr/bin:/bin:/etc ; export PATH # Set the PATH
UGS_TMP=/tmp/ugs_tmp # Define a stash area for old files.
PS_CMD="ps -ef" # ps command for this system.
DF_CMD="df -k" # df command for this system.
AWK_CMD=awk # awk command for this system.
TMP_DIR=/tmp # Tmp directory.
LPATH_VAR_NAME=LD_LIBRARY_PATH # Library path var name. V160P14
alias -x pwd='pwd -L' # Tweak Linux pwd to give logical pwd.
alias -x uncompress=gunzip # On SuSE 10 must use gunzip. NX050P24
;;
AIX) # Machine type AIX.
PATH=/usr/bin:/etc:/etc/yp:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/etc:.
export PATH # Set the PATH
UGS_TMP=/tmp/ugs_tmp # Define tmp dir for old files.
X11_DEFS_DIR=/etc/X11/app-defaults # X11 app-defaults dir.
PS_CMD="ps -ef" # ps command for this system.
AWK_CMD=awk # awk command for this system.
DF_CMD="df -I" # df command for this system.
TMP_DIR=/tmp # Tmp directory.
LPATH_VAR_NAME=LIBPATH # Library path var name. V160P14
;;
HP-UX) # Machine type is HP
# Check if the HP-UX is at least V11. test w/o leading letters or decimal.
[ "${REV#*${REV%%[0-9]*}}" -lt 11 ] && { # Pre V11 no longer supported.
print "${ERR} $MACHINE $REV is not supported." >&2 ; exit 1
}
PATH=.:/usr/sbin:/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin
UGS_TMP=/tmp/ugs_tmp # Define a tmp area for old files.
X11_DEFS_DIR=/etc/X11/app-defaults # X11 app-defaults dir.
AWK_CMD=awk # awk command for this system.
DF_CMD=bdf # df command for this system.
PS_CMD="ps -ef" # ps command for this system.
TMP_DIR=/tmp # Tmp directory.
LPATH_VAR_NAME=SHLIB_PATH # Library path var name. V160P14
;;
SunOS) # Machine type SUN.
case $REV in
5*) # OS is Solaris.
PATH=.:/sbin:/usr/sbin:/usr/bin:/bin:/etc ; export PATH # Set the PATH
UGS_TMP=/var/tmp/ugs_tmp # Define a stash area for old files.
X11_DEFS_DIR=/usr/openwin/lib/app-defaults # X11 app-defaults dir.
PS_CMD="ps -ef" # ps command for this system.
DF_CMD="df -k" # df command for this system.
AWK_CMD=nawk # awk command for this system.
TMP_DIR=/var/tmp # Tmp directory.
LPATH_VAR_NAME=LD_LIBRARY_PATH # Library path var name. V160P14
;;
*) print "${ERR} $MACHINE $REV is not supported." >&2 ; exit 1
;;
esac
;;
*) print "${ERR} $MACHINE is not supported." >&2 ; exit 1
;;
esac
a skript zkusím spustit:
[root@jester-fedora NX_9]# sh ./ug_install
grep: Nepřípustný konec rozsahu
./ug_install: řádek 41: print: příkaz nenalezen
./ug_install: řádek 107: print: příkaz nenalezen
nebo takto:
[root@jester-fedora NX_9]# ksh ./ug_install
grep: Nepřípustný konec rozsahu
[root@jester-fedora NX_9]#
nebo to zkustím různě takto:
[root@jester-fedora NX_9]# ksh ./ug_install
grep: Nepřípustný konec rozsahu
[root@jester-fedora NX_9]# ksh
# cd /home/jester/NX_9
# ./ug_install
ksh: ./ug_install: cannot execute [Operace zamítnuta]
# /home/jester/NX_9/ug_install
ksh: /home/jester/NX_9/ug_install: cannot execute [Operace zamítnuta]
# ksh /home/jester/NX_9/ug_install
grep: Nepřípustný konec rozsahu
# cd /home/jester/NX_9/ug_install
ksh: cd: /home/jester/NX_9/ug_install: [není adresářem]
# /home/jester/NX_9/ug_install
ksh:
Najde se někdo, kdo by mi s tím mohl pomoci? Děkuji za Váš čas.