Tag: shell

Here you can see a listing of all the posts tagged with shell on this website.

  • Shell meme

    Posted on April 11, 2008 at 08:20 +0200 Tagged with , ,

    Finally a geeky meme :D

    $ history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head
       90   cd
       74   hg
       65   python
       40   ls
       39   git
       33   curl
       19   mate
       18   bash
       15   ssh
       14   mvn
    

    Too bad history isn't really global, still a nice meme for a change :-)

    1 comment

  • SSH Commands on Ubuntu Servers

    Posted on Jan. 5, 2008 at 15:45 +0100 Tagged with , ,

    Fighting with environment variables via SSH on an Ubuntu server? You're definitely not alone there. Normally when running ssh <server> <command> the user's ~/.bashrc should be sourced (if the user has Bash as shell) but for some reason, none of my variables got loaded.

    After quite some googling, I found this post that described the same problem I had but also contained a simple solution in the comments section: Actually reading the .bashrc ;-) Ubuntu's default .bashrc starts with following line:

    [ -z "$PS1" ] && return
    

    The problem is now, that this condition is actually true via ssh <command>. To solve this you have more or less 2 options: Add you stuff before this line or remove this line.

    Just stupid that it took me about an hour to find this problem ;)

    0 comments

  • Know your terminal with tput

    Posted on March 4, 2007 at 17:29 +0100 Tagged with , , ,

    From time to time I have to write shell programs that should print big amounts of text to the terminal. In these situations it would be nice to know at least the horizontal dimension of the terminal to be able to mess for example with the indentation of the lines. So far I always simply took 80 (the default with of most terminal), but thanks to a recipe in the Python Cookbook (Recipe 1.25 by Brent Burley and Mark Moraes) I now know the tput command :)

    [more ...]

    0 comments

  • Everyday something new to learn with Unix

    Posted on Aug. 15, 2006 at 00:49 +0200 Tagged with , , ,

    What I love about Unix? Well, that you learn something new every day ;-) (just to name one thing I love about it ...). So I'm currently in the process of learning some new frameworks and also getting more familiar with Perl (for ... I think it's now the 4th time). Today I started messing a little bit around with Django and also more or less by accident started watching some of the webcasts posted on the Plone website. Very informative and entertaining stuff esp. if you've already at least seen some source code produced for the mentioned technologies there (and I don't mean Zope/Plone) ;-)

    [more ...]

    0 comments