sh awk sed test cat rm lns tr n c contains Loc Options Tr src trnl ln
?MAKE: -pick wipe $@ %<
?S:myuname:
-?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix,
-?S: pseudo variables assignments in the output are stripped, thank you. The
-?S: whole thing is then lower-cased.
+?S: The output of 'uname -a' if available, otherwise the hostname.
+?S: The whole thing is then lower-cased and slashes and single quotes are
+?S: removed.
?S:.
?S:hint:
?S: Gives the type of hints used for previous answers. May be one of
?X: Now not using a subshell but instead $test.
myuname=`$uname -a 2>/dev/null`
$test -z "$myuname" && myuname=`hostname 2>/dev/null`
-?X: Special mention for Xenix, whose 'uname -a' gives us output like this:
-?X: sysname=XENIX
-?X: nodename=whatever
-?X: release=2.3.2 .. etc...
-?X: Therefore, we strip all this variable assignment junk and remove all the
-?X: new lines to keep the myuname variable sane... --RAM
+# Downcase everything to avoid ambiguity.
+# Remove slashes and single quotes so we can use parts of this in
+# directory and file names.
+# Remove newlines so myuname is sane to use elsewhere.
# tr '[A-Z]' '[a-z]' would not work in EBCDIC
# because the A-Z/a-z are not consecutive.
-myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
+myuname=`echo $myuname | $sed -e "s,['/],,g" | \
./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
?X: Save the value we just computed to reset myuname after we get done here.
newmyuname="$myuname"
osname=uwin &&
osvers="$5"
-?X: If we have uname, we already computed a suitable uname -a output, correctly
-?X: formatted for Xenix, and it lies in $myuname.
+?X: If we have uname, we already computed a suitable uname -a output,
+?X: and it lies in $myuname.
if $test -f $uname; then
set X $myuname
shift