Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

July 21 2011


shocco is a quick-and-dirty, literate-programming-style documentation generator written for and in POSIX shell. It borrows liberally from Docco, the original Q&D literate-programming-style doc generator.

shocco(1) reads shell scripts and produces annotated source documentation in HTML format. Comments are formatted with Markdown and presented alongside syntax highlighted code so as to give an annotation effect. This page is the result of running shocco against its own source file.

July 20 2011

December 22 2010

December 10 2010

How to Debug Bash Scripts | Ayman Hourieh

various techniques and tips for debugging Bash scripts.
Reposted byreturn13 return13

December 02 2010

Reference Cards

reference cards provide a useful summary of certain scripting concepts. The foregoing text treats these matters in more depth, as well as giving usage examples.

September 18 2010

# LOL!!1

alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'

alias visible='echo'
alias invisible='cat'
alias moar='more'

alias icanhas='mkdir'
alias donotwant='rm'
alias dowant='cp'
alias gtfo='mv'

alias hai='cd'
alias plz='pwd'

alias inur='locate'

alias nomz='ps -aux'
alias nomnom='killall'

alias cya='reboot'
alias kthxbai='halt'
Reposted bycmdrfletcherkrannixcoloredgrayscaleserapsychoblotterlebenididntorderthatNorkNorkphr33kaberinkulassobaNF-700Necrotexfooselmazzoomondkroeteknarfsixtussciphexstefreakblubberthetoothvroomjmtosseshgnmburgerauthmillenonthorbenjaweswoopodessa2LeuXcitizen428kannsdennwahrseinElbenfreundfadenboelsenwakadatenwolfG33KatWorkpenpenreturn13splitbrainnicapicellaablsicksinmikeybertstmi

September 09 2010

Filenames in Shell

This little essay explains how to correctly process filenames in Bourne shells. I presume that you already know how to write Bourne shell scripts.

May 26 2010

shflags - Project Hosting on Google Code

Shell Flags (shFlags) is a library written to greatly simplify the handling of command-line flags in Bourne based Unix shell scripts (bash, dash, ksh, sh, zsh) on many Unix OSes (Linux, Solaris, Mac OS X, etc.).

Most shell scripts use getopt for flags processing, but the different versions of getopt on various OSes make writing portable shell scripts difficult. shFlags instead provides an API that doesn't change across shell and OS versions so the script writer can be confident that the script will work.

August 05 2009

August 04 2009

Anton Olsen.com » Blog Archive » BASH: Split a string without ‘cut’ or ‘awk’

For a little test script I’m writing I needed to split a line on a ‘;’ but preservere the “s and ’s, something that echo doesn’t like to do. Digging deeper into the bash docs I see that there are some handy string handling functions. #!/bin/bash line=’this “is” a command;this “is” a pattern’ COMMAND=${line%;*} PATTERN=${line#*;} echo $COMMAND echo $PATTERN

July 23 2009

July 10 2009

How to identify what processes are generating IO Wait load. | ScriptBits, Little Bits Of Code You Cannot Live Without

An easy way to identify what process is generating your IO Wait load is to enable block I/O debugging. This is done by setting /proc/sys/vm/block_dump to a non zero value like: echo 1 > /proc/sys/vm/block_dump This will cause messages like the following to start appearing in dmesg: bash(6856): dirtied inode 19446664 (ld-2.5.so) on md1 Using the following one-liner will produce a summary output of the dmesg entries: dmesg | egrep "READ|WRITE|dirtied" | egrep -o '([a-zA-Z]*)' | sort | uniq -c | sort -rn | head 354 md 324 export 288 kjournald 53 irqbalance 45 pdflush 14 portmap 14 bash 10 egrep 10 crond 8 ncftpput Once you are finished you should disable block I/O debugging by setting /proc/sys/vm/block_dump to a zero value like: echo 0 > /proc/sys/vm/block_dump

July 07 2009

vi cheat sheet

Keyboard maps * readline * vi/vim * vimperator * mutt * nethack Unicode characters * digraphs * charsets * common glyphs

May 04 2009

hubertf's NetBSD blog

NetBSD's systat(1) offers the -t option to switch to the display after a given number of cycles. I'd love to have something similar in screen(1), but couldn't find it from a brief RoTFM. As a result, I came up with the following line, which -- when ran inside a screen(1) session -- skips through screens 0 to 4: sh -c 'n=0; while true ; do echo n=$n ; screen -x -X select $n ; \ n=`expr $n + 1`; if [ $n = 4 ]; then n=0; fi ; sleep 5 ; done' This assumes that there are four screen sessions running. Determining the number of screen sessions actually running as well as skipping the one running this code is left as an exercise to the reader.
Tags: shell bash screen

April 09 2009

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!