Changing the Bash prompt
export PS1="\n\u@\H>"
I tried the above example on Ubuntu 7.10.
Reference:
Tip: Prompt magic [ibm.com]
Bash Prompt HOWTO [tldp.org]
DZone Snippets > jrobertson > shell
11305 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
James Robertson http://www.r0bertson.co.uk
export PS1="\n\u@\H>"
curl -s checkip.dyndns.org
curl -s checkip.dyndns.org|cut -d ":" -f2|cut -d "<" -f1
git clone git@github.com:jrobertson/projectx.git
cd projectx
cp ../projectx2/feed.rb .
git add feed.rb
git commit -a # add a message associated with this file revision
git push # updates the changes back to the server
sudo apt-get install curl
sudo gedit /usr/bin/jaitwit
curl http://rorbuilder.info/api/projectx.cgi?xml_project=%3Cproject%20name=%22micro_blog%22%3E%3Cmethods%3E%3Cmethod%20name=%22post2jaiku%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22location%22%20val=%22YourCity%22/%3E%3Cparam%20var=%22apikey%22%20val=%22YourAccessKey%22/%3E%3C/params%3E%3C/method%3E%3Cmethod%20name=%22post2twitter%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22password%22%20val=%22YourPassword%22/%3E%3C/params%3E%3C/method%3E%3C/methods%3E%3C/project%3E -o /dev/null echo Message Sent!
chmod +x /usr/bin/jaitwit
jaitwit "message here without the quotes"
espeak -f hello_jr -s 120
(1..5).each {|i| `wget --user=jrobertson --password=secret http://twitter.com/account/archive?page=#{i}`}
tidy -asxhtml -numeric < index.html > index.xml
wget -O projxmlbase.rb http://xml.mysqueak.info/p/projxmlbase.rb
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="crontab_entry"> <xsl:apply-templates select="minutes"/> <xsl:apply-templates select="hours"/> <xsl:apply-templates select="day_of_month"/> <xsl:apply-templates select="months"/> <xsl:apply-templates select="day_of_week"/> <xsl:value-of select="command" /> </xsl:template> <xsl:template match="minutes"> <xsl:apply-templates select="minute"/> <xsl:if test="not(minute) or minute=''">*</xsl:if> <xsl:call-template name="format_unit" /> </xsl:template> <xsl:template match="hours"> <xsl:apply-templates select="hour"/> <xsl:if test="not(hour) or hour=''">*</xsl:if> <xsl:call-template name="format_unit" /> </xsl:template> <xsl:template match="day_of_month"> <xsl:apply-templates select="day"/> <xsl:if test="not(day) or day=''">*</xsl:if> <xsl:call-template name="format_unit" /> </xsl:template> <xsl:template match="day_of_week"> <xsl:apply-templates select="day"/> <xsl:if test="not(day) or day=''">*</xsl:if> <xsl:call-template name="format_unit" /> </xsl:template> <xsl:template match="months"> <xsl:apply-templates select="month"/> <xsl:if test="not(month) or month=''">*</xsl:if> <xsl:call-template name="format_unit" /> </xsl:template> <xsl:template match="month"> <xsl:call-template name="format_value" /> </xsl:template> <xsl:template match="day"> <xsl:call-template name="format_value" /> </xsl:template> <xsl:template match="hour"> <xsl:call-template name="format_value" /> </xsl:template> <xsl:template match="minute"> <xsl:call-template name="format_value" /> </xsl:template> <xsl:template name="format_value"> <xsl:value-of select="."/> <xsl:if test="not(position() =last())"><xsl:text>,</xsl:text> </xsl:if> </xsl:template> <xsl:template name="format_unit"> <xsl:call-template name="recurring" /> <xsl:text> </xsl:text> </xsl:template> <xsl:template name="recurring"> <xsl:if test="@every">/<xsl:value-of select="@every"/> </xsl:if> </xsl:template> </xsl:stylesheet>
<crontab_entry> <minutes/> <hours every="3"> <day_of_month> <day>3</day> <day>10</day> <day>15</day> </day_of_month> <months/> <day_of_week/> <command>ssh james@192.168.1.220 runjob.sh</command> </crontab_entry>
<cron> <minutes> <!-- minute (0 - 59) --> <minute></minute> </minutes <hours> <!-- hour (0 -23) --> <hour></hour> </hours> <day_of_month> <!-- day of month (1 - 31) --> <day></day> </day_of_month> <months> <!-- month (1 - 12) --> <month></month> </months> <day_of_week> <!-- day of week (0 - 6) (Sunday=0 or 7) --> <day></day> </day_of_week> <command></command> </cron>
require 'fileutils' FileUtils.rm_r 'sample'