any recommendations are welcome.
thanks aragon
Code: Select all
#!/bin/sh
#
# this script should be a replacement for xterm and rxvt using sakura. as sakura
# does not understand most option of xterm/rxvt, we try to only commit those it
# does:
# -hold (only Xterm)
# -title/-T
# -e
#
# aragon, 2010.01.19
## variables
inp="${*}" #all params
hold="`echo "${inp}" | grep -e -hold`" #is hold in params
title="`echo "${inp}" | tr "-" "\n" | grep -e "^title " | sed 's/title //'`" #get title from -title
ttitle="`echo "${inp}" | tr "-" "\n" | grep -e "^T " | sed 's/T //'`" #get title from -T
exe="`echo "${inp}" | tr "-" "\n" | grep -e "^e " | sed 's/e //'`" #get command to execute from -e
## set hold-option from -hold
if [ ! -z "${hold}" ]
then
sakhold="-h"
else
sakhold=""
fi
## set title-option from -title or -T
if [ ! -z "${title}" ]
then
saktitle="-t '"${title}"'"
elif [ ! -z "${ttitle}" ]
then
saktitle="-t '"${ttitle}"'"
else
saktitle=""
fi
## set execute-option from -e
if [ ! -z "${exe}" ]
then
sakexe="-e ${exe}"
else
sakexe=""
fi
## build output and squeeze blanks in output
sakoutput="`echo "sakura "${sakhold}" "${saktitle}" "${sakexe}"" | tr -s " "`"
## output (later without echo)
echo "${sakoutput}"