how to save an output of a command in a variable

Hi,

in shell script, i have the command swstart -p which returns an output. i want to store the output of this command into a variable. how i can do that

excerpt from the script

#!/usr/bin/ksh
#
#
#
# Program:      swstart -p
#
# Description:  Starts the sentinels on Slave server

DIR="/local/home/mike/software"

$DIR/bin/swstart -p

Thanks
Mike

VAR=$(/local/home/mike/software/bin/swstart -p)

or:

VAR=$($DIR/bin/swstart -p)

of course :wink:

or (old fashion)

VAR=`$DIR/bin/swstart -p`

Thanks a lot folks !!!! :slight_smile: