Bash/shellに投稿されたコード一覧

Bash/shell Linux上でhspのスクリプトをコンパイルし実行用shファイルを生成するsh

#!/bin/sh
./hspcmp $1 -o$1.ax
printf "#!/bin/sh\n./hsp3 %s" $1.ax > $1.sh
chmod u+x $1.sh
./hsp3 $1.ax

Bash/shell SCREENを使用中の

renice -xx -p `ps -ef | grep "java" |grep -v "SCREEN" |grep -v "grep" |awk '{print $2}'`

Bash/shell shcでバイナリ化

# wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz
# tar xvfz shc-3.8.9.tgz
# cd shc-3.8.7
# make

Bash/shell 僕のプロンプト

PS1='\a\h:\w \u$ '
PS1='\a\h:\W \u$ '

Bash/shell Macでcss2lessインストール

$ sudo curl -o /usr/local/bin/css2less https://raw.github.com/sickill/css2less/master/css2less.rb$
$ sudo chmod a+x /usr/local/bin/css2less

Bash/shell how to extract text data from web page.

grep hayano hayano.html |grep status |grep 2011 |sed -e s%^.*blank\"\>%% -e s%"</a>"$%% |sed -e s%/%" "%g -e s%:%" "%g

Bash/shell /etc/rc.d/init.d/php-fastcgi

#! /bin/sh
#
# spawn-fcgi   Start and stop FastCGI processes
#
# chkconfig:   - 80 20
# description: Spawn FastCGI scripts to be used by web servers
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
SPAWNFCGI="/usr/bin/spawn-fcgi"
PHPFCGI="/usr/bin/php-cgi"
FCGIPORT="9000"
FCGIADDR="127.0.0.1"
PHP_FCGI_CHILDREN=8
PHP_FCGI_MAX_REQUESTS=1000
ALLOWED_ENV="PATH USER"
USER=nginx
GROUP=nginx
PIDFILE=/var/run/phpfcgi.pid
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS"
END_ALLOC"
case "$1" in
  start)
        PHPFCGI_START=$"Starting ${NAME} service: "
        echo -n $PHPFCGI_START
        # clean environment
        E=for i in $ALLOWED_ENV; do E="$E $i=${!i}"; done
        daemon $SPAWNFCGI -a ${FCGIADDR} -p ${FCGIPORT} -u ${USER} -g ${GROUP} -P $
{PIDFILE} -C ${PHP_FCGI_CHILDREN} -f ${PHPFCGI}
        RETVAL=$?
        ;;
  stop)
        echo -n "Stopping php-fcgi: "
        killproc -p $PIDFILE phpfcgi
        echo
        RETVAL=$?
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac
exit $RETVAL

Bash/shell /etc/rc.d/init.d/php-fastcgi

#! /bin/sh
#
# spawn-fcgi   Start and stop FastCGI processes
#
# chkconfig:   - 80 20
# description: Spawn FastCGI scripts to be used by web servers
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
SPAWNFCGI="/usr/bin/spawn-fcgi"
PHPFCGI="/usr/bin/php-cgi"
FCGIPORT="9000"
FCGIADDR="127.0.0.1"
PHP_FCGI_CHILDREN=8
PHP_FCGI_MAX_REQUESTS=1000
ALLOWED_ENV="PATH USER"
USER=nginx
GROUP=nginx
PIDFILE=/var/run/phpfcgi.pid
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS"
END_ALLOC"
case "$1" in
  start)
        PHPFCGI_START=$"Starting ${NAME} service: "
        echo -n $PHPFCGI_START
        # clean environment
        E=for i in $ALLOWED_ENV; do E="$E $i=${!i}"; done
        daemon $SPAWNFCGI -a ${FCGIADDR} -p ${FCGIPORT} -u ${USER} -g ${GROUP} -P $
{PIDFILE} -C ${PHP_FCGI_CHILDREN} -f ${PHPFCGI}
        RETVAL=$?
        ;;
  stop)
        echo -n "Stopping php-fcgi: "
        killproc -p $PIDFILE phpfcgi
        echo
        RETVAL=$?
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac
exit $RETVAL

Bash/shell オプション付き git-log のエイリアス

hist = log --graph --pretty=format:'%Cred%h%Creset - %cd | %s %Cgreen(%cr)%C(yellow)%d%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=short

Bash/shell 簡易Webサーバー

$ python -m CGIHTTPServer
Total Pages: 1 / 212

よく投稿されているコード

タグ

最近投稿されたコード