linux command wrap

时间:2023-03-09 15:42:14
linux command  wrap

$ cat tmux-attach

 if [ -z $ ] ; then
tmux ls
else
tmux attach -t $
fi

$ cat /usr/bin/cscope-go.sh

 #!/bin/bash

 # generate cscope index files in current directory
# the generated cscope index files also include go standard packages if [ "$GOROOT" = "" ] ; then
echo "GOROOT is not set"
GOROOT=`go env |grep "GOROOT" |cut -d "=" -f2`
GOROOT=${GOROOT#\"}
GOROOT=${GOROOT%\"}
fi
echo $GOROOT go_pkg_src=$GOROOT/pkg find $go_pkg_src -name "*.go" -print > cscope.files
find . -name "*.go" -print >> cscope.files if cscope -b -k; then
echo "Done"
else
echo "Failed"
exit
fi

gopath.sh

 GOROOT=`go env |grep "GOROOT" |cut -d "=" -f2`
GOROOT=${GOROOT#\"}
GOROOT=${GOROOT%\"}
echo $GOROOT GOPATH=`go env |grep GOPATH |cut -d "=" -f `
GOPATH=${GOPATH%\"}
GOPATH=${GOPATH#\"}
echo $GOPATH
10 declare -x GOROOT
11 declare -x GOPATH
12 export PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin