» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with Unix + shell

best of craigslist : Help me keep the shell people alive.

"I need a woman (obviously) who is willing to raise a child with me in the method of Unix"

Emacs: del.icio.us tag/emacs

rush

A replacement for the unix shell (bash, zsh, etc) which uses pure Ruby syntax.

git: del.icio.us tag/git

The best in command line xml: XMLStarlet

Quite some time ago I wrote about using xsltproc to process xml on the command line. Thank fully someone pointed out XMLStarlet.  I now use XMLStarlet almost every day.  I work with a variety of REST based API’s gather information. XMLStartlet along with a simple for loop or xargs gives you an exceedingly powerful set of tools.

Here is a quick introduction into the power of XMLStarlet. This is just a teaser as I cannot share the data I work with. However, you should be able to see the power of this tool.

All the links from my RSS feed:

$ curl -s 'http://bashcurescancer.com/rss/' | xml sel -t -m '//link' -v '.' -n
http://bashcurescancer.com
http://bashcurescancer.com/processing-xml-on-the-command-line.html
http://bashcurescancer.com/do-not-close-stderr.html
http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html
http://bashcurescancer.com/bug-in-curl-is-fixed.html
http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html
http://bashcurescancer.com/performance-testing-with-curl.html
http://bashcurescancer.com/new-command-prepend.html
http://bashcurescancer.com/shell-function-which-webserver-does-that-site-run.html
http://bashcurescancer.com/exposing-command-line-programs-as-web-services.html
http://bashcurescancer.com/wrapping-dynamic-languages-in-shell-without-an-extra-script.html

Or how about “Title: link”

$ curl -s 'http://bashcurescancer.com/rss/' | xml sel -t -m '//item' -v 'title' -o ': ' -v 'link' -n
Processing XML on the Command Line: http://bashcurescancer.com/processing-xml-on-the-command-line.html
Do not close stderr: http://bashcurescancer.com/do-not-close-stderr.html
prepend to a file with sponge from moreutils: http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html
Bug in Curl is fixed: http://bashcurescancer.com/bug-in-curl-is-fixed.html
using kill to see if a process is alive: http://bashcurescancer.com/using-kill-to-see-if-a-process-is-alive.html
Performance testing - with curl: http://bashcurescancer.com/performance-testing-with-curl.html
New command: prepend: http://bashcurescancer.com/new-command-prepend.html
Shell Function - Which Webserver Does That Site Run?: http://bashcurescancer.com/shell-function-which-webserver-does-that-site-run.html
Exposing command line programs as web services: http://bashcurescancer.com/exposing-command-line-programs-as-web-services.html
Wrapping dynamic languages in shell without an extra script: http://bashcurescancer.com/wrapping-dynamic-languages-in-shell-without-an-extra-script.html

You may need to do some reading on xpaths and xsl stylesheets to use the full power of the tool.

Unix: BASH Cures Cancer Blog

rlwrap

"'readline wrapper' that uses the GNU readline library to allow the editing of keyboard input for any other command."

opensource: del.icio.us tag/opensource

MultiTail - Tail on Steroids

"MultiTail lets you view one or multiple files like the original tail program."

opensource: del.icio.us tag/opensource

EmacsWiki: Carbon Emacs Package

Setting PATH and other Unix variable in a Aqua-compatible and DRY way

Emacs: del.icio.us tag/emacs

Goosh.org - NOT an Official Google Shell

After reviewing my statistics today, I found a couple referrals from this website, goosh.org. At first, I did not think much of its Spartan appearance (like I have room to talk). But after tinkering with it awhile, I realized it was pretty darn functional. As you can see below, it behaves similar to a UNIX shell.

By the way, the author of the utility states this is NOT an official Google product! As usual, here is an example run.

Goosh goosh.org 0.4.4-beta #1 Tue, 03 Jun 08 22:59:00 UTC Google/Ajax

Welcome to goosh.org - the unofficial google shell.

This google-interface behaves similar to a unix-shell.
You type commands and the results are shown on this page.

goosh is powered by google.

goosh is written by Stefan Grothkopp (email address deleted)
it is NOT an official google product!

Your language has been set to: en (use lang to change it)
Enter help or h for a list of commands.

guest@goosh.org:/web>
guest@goosh.org:/web> help

help

command aliases parameters function
web (search,s,w) [keywords] google web search
lucky (l) [keywords] go directly to first result
images (image,i) [keywords] google image search
wiki (wikipedia) [keywords] wikipedia search
clear (c) clear the screen
help (man,h,?) [command] displays help text
news (n) [keywords] google news search
blogs (blog,b) [keywords] google blog search
feeds (feed,f) [keywords] google feed search
open (o) open url in new window
go (g) open url
more (m) get more results
in (site) search in a specific website
load load an extension
video (videos,v) [keywords] google video search
read (rss,r) read feed of url
place (places,map,p) [address] google maps search
lang change language
addengine add goosh to firefox search box
translate (trans,t) [lang1] [lang2] google translation
ls [command] lists commands
cd change mode

- Enter green commands without parameters to change default mode.
- Anything that's not a command will search in current default mode.
- Aliases will expand to commands. Numbers will expand to corresponding search results.
- Use cursor up and down for command history.
- Enter keyword and hit the tab-key for tab-completion.

guest@goosh.org:/web> translate english spanish Father's Day
translating "Father's Day" from "english" to "spanish":

"Día del Padre"

guest@goosh.org:/web> t english german Father's Day
translating "Father's Day" from "english" to "german":

"Vatertag"

Unix: My SysAd Blog

XMLStarlet Command Line XML Toolkit: Overview

XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands.

XML: del.icio.us/tag/xml

UNIX pipes as IO monads

essay builds an equivalence table between the IO monad and UNIX shell pipe operations

Haskell: del.icio.us tag/haskell

Squawk: simple queues using awk

Reliable messaging from your shell scripts; activemq via the power of awk

Netcat: del.icio.us tag/netcat

Shell Based Random Number Generator

I observed a a few searches in my metadata stats for a shell based random generator. I know Korn, Bash, and Z Shell shells support a RANDOM variable. Depending on the shell, I will use a print and/or echo command to output its value. The pseudo-random generator outputs an integer between 0 and 32767 - yes, a very limited range. Here are a few examples for these three different shells.

Korn Shell
# ksh
# echo $RANDOM
23508
# echo $RANDOM
22618
# echo $RANDOM
1864
# echo $RANDOM $RANDOM
4958 29989
# print $RANDOM
30418
# print $RANDOM
4992
# print $RANDOM $RANDOM $RANDOM
29436 27342 12946

Seed the sequence of numbers
# RANDOM=100
# print $RANDOM
12662
# echo $RANDOM
23392
# RANDOM=100
# echo $RANDOM
12662
# echo $RANDOM
23392

Bash Shell
# bash
# echo $RANDOM
3107
# echo $RANDOM
7897

Z Shell
# zsh
# print $RANDOM
32274
# for i in {1..10}
for> do
for> print $RANDOM
for> done
10740
12659
9498
2798
3541
10384
21216
15221
22157
15198

Seed the sequence of numbers
# RANDOM=`date '+%H%S'`
# echo $RANDOM
12488
# echo $RANDOM
5266

Unix: My SysAd Blog

Using Z Shell Brace Expansion to Create Test Files

Here is a convenient way of creating test files using the powerful Z Shell. I have been using this shell for a short while, and I am quickly becoming a fan of it. I used it to support transfer speed tests. To support these tests, I created a specified number of files that varied in size (1MB, 5MB, 10MB, 50MB, 100MB, 500MB, etc). Here is a straightforward one-liner mkfile example of creating 50 x 12MB files and a few others using zsh’s brace expansion.

# zsh
# mkfile 12m {1..50}.tst
# ls -l
total 122960
-rw------T 1 root other 12582912 Feb 18 20:04 1.tst
-rw------T 1 root other 12582912 Feb 18 20:04 2.tst
-rw------T 1 root other 12582912 Feb 18 20:04 3.tst
-rw------T 1 root other 12582912 Feb 18 20:04 4.tst
-rw------T 1 root other 12582912 Feb 18 20:04 5.tst
...

Other examples...

# touch {1..5}.testfile
# ls -l
total 0
-rw-r--r-- 1 root other 0 Feb 18 20:07 1.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 2.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 3.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 4.testfile
-rw-r--r-- 1 root other 0 Feb 18 20:07 5.testfile

# touch {6..10}.data
# ls -l
total 0
-rw-r--r-- 1 root other 0 Feb 18 20:30 1.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 10.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 2.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 3.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 4.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 5.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 6.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 7.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 8.data
-rw-r--r-- 1 root other 0 Feb 18 20:30 9.data

# ls -l {1..5}.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 1.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 2.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 3.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 4.data
-rw-r--r-- 1 root other 0 Feb 18 20:26 5.data

Unix: My SysAd Blog

Page 1 | Next >>