On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
if {the first word of uname -a is Linux}
Hi, Colin and others gave correct answers :-)
Just for the heck, I have no awk, no sed, no shell pattern match to
do this.
#!/bin/sh
get_first () {
BUFFER=$1
}
get_first `uname -a`
if [
This oughtta be simple for your scripters out there . . .
I need to run a test in a .bashrc startup script to see whether the
machine the user is logging onto is a Solaris or a Linux box (the /home
directory is shared between the two, and paths need to be modified
according to which OS is
Kent,
Just use `uname -s`. This will report back Linux on Linux and
SunOS on Solaris.
Steve
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
This oughtta be simple for your scripters out there . . .
I need to run a test in a .bashrc startup script to see whether the
machine
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
I need to run a test in a .bashrc startup script to see whether the
machine the user is logging onto is a Solaris or a Linux box (the /home
directory is shared between the two, and paths need to be modified
according to which OS is
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
This oughtta be simple for your scripters out there . . .
Hi, Kent
You have to understand the difference between a pipe ``|'', and a
command substitution ``$(foo)'' (backticks can be used instead of $(),
when nesting isn't needed).
The
On Wed, Jan 14, 2004 at 06:14:45PM +, Colin Watson wrote:
} On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
} I need to run a test in a .bashrc startup script to see whether the
} machine the user is logging onto is a Solaris or a Linux box (the /home
} directory is shared
Steve Mayer wrote:
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
I need to run a test in a .bashrc startup script to see whether the
machine the user is logging onto is a Solaris or a Linux box (the /home
directory is shared between the two, and paths need to be modified
Colin Watson wrote:
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
I need to run a test in a .bashrc startup script . . .
if {the first word of uname -a is Linux}
Why not just use 'uname', which prints Linux on Linux and SunOS on
Solaris?
That solves my problem! Thanks!
Gregory Seidman wrote:
} On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
} I need to run a test in a .bashrc startup script
}
} if {the first word of uname -a is Linux}
}
if expr `uname -a` : 'Linux ' /dev/null
Thanks!
--
Kent
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
Jan Minar wrote:
On Wed, Jan 14, 2004 at 11:59:12AM -0600, Kent West wrote:
This oughtta be simple for your scripters out there . . .
The script follows:
#!/bin/sh
case $(uname -a | awk '{print $1}') in
Linux)
echo Hi, I'm Linus Torvalds I pronounce Linux as Linux.
;;
Solaris)
Kent West [EMAIL PROTECTED] writes:
if {the first word of uname -a is Linux}
then echo You're logging into Linux
else
echo You're logging into something else, probably Solaris
fi
For yet another approach:
case `uname -a` in
Linux*)
echo You're logging into Linux
;;
*)
On Wed, Jan 14, 2004 at 05:43:18PM -0500, David Z Maze wrote:
case `uname -a` in
Linux*)
O-oh, I completely missed the possibility not to use awk friends...
Which has the minor advantage of only using shell primitives, aside
from the call out to uname itself.
Heh, yet I have something
12 matches
Mail list logo