#!/bin/sh if [ $# -lt 1 ] ;then echo save_s_context file command echo Save the security context in file and execute a command else CTX=`grep ^s_context: /proc/self/status | sed s/s_context:// | (read a b; echo $a)` CTX=`eval expr $CTX + 0` echo S_CONTEXT=$CTX >$1 echo S_PROFILE=$PROFILE >>$1 shift exec "$@" fi