On Wed, 2006-03-01 at 08:13 +0100, Patrick.Le-Dot wrote:
> > ...
> > I have just found out how I must do it.
> >
> > # echo res=cpu,guarantee=-2,limit=-2,total_guarantee=100,max_limit=-2 >
> > /configfs/ckrm/class1/shares
>
> The "cat" cmd can be used to display error message (if any) :
>
> # echo "res=cpu,total_guarantee=100" | cat > /configfs/ckrm/class1/shares
>
> The "echo" cmd does not check the return code and error message
> (if any) are displayed on the console only.
>
> Patrick
Assuming you're using bash you can check the exit code with:
echo 'res=cpu,total_guarantee=100' > /config/ckrm/class/shares
echo $?
And you can exit if there was an error in many ways:
trap 'echo "Yikes. There was an error."' ERR
set -e (or was it +e ??)
echo 'res=cpu,total_guarantee=100' > /config/ckrm/class/shares
OR
echo 'res=cpu,total_guarantee=100' > /config/ckrm/class/shares || exit
-1
OR
echo 'res=cpu,total_guarantee=100' > /config/ckrm/class/shares
if [ "$?" != "0" ]; then
echo "error"
fi
Cheers,
-Matt Helsley
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech