Unix Hosting News & Commentary

Appendix A: Media 759 10. Insert a blank CD into the CD burner drive, which may be a combination with your DVD drive. (If a CD/DVD Creator window pops up, you can just close it.) Figure A-1: Use K3b to burn your installation CDs. 11. Check the settings on the Burn CD Image window (often the defaults are fine, but you may want to slow down the speed if you get some bad burns) and click Start. 12. When the CD is done burning, eject it (or it may eject automatically) and mark it appropriately (information such as the distribution name, version number, and date). Now you re ready to begin installing (or booting) the Linux distribution you just burned. Refer to Chapter 7 for general information on installing Linux. Then go to the chapter that covers your particular distribution to find its specific installation procedure. If you don t have Linux installed or K3b available at the moment, you can burn CDs from any CD-burning application you have available. There s a nice overview of CD installation tools and how to use them to burn CDs at the Gentoo Web site It describes disk-burning tools that are available on Windows, Mac OS X, and Linux systems. . . .
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Less then 48 hours after rr becomes 1.0 it gets a few very handy improvements!

In place modification of files is activated via the –modify (or shorthand -m) option. This means that you can bypass any output redirection and just go straight to modifying the original file. This feature does use filename.tmp as a temp file which it later renames to the original filename. Again if no filenames are specified then input is expected to come from STDIN and therefore the new –modify option will be ignored in this special case.

Another original goal of mine was adding support for multiple filenames. Specifically so that useful shell tricks like *.txt file globbing would work nicely with rr. Well support has been added and it works great with the new –modify option.

The usage message has been cleaned up a bit but here is the very basic usage for all new people.

usage: rr [options] find replace [filenames] rr [options] s/find/replace/ [filenames]

I wanted to point out a rather hidden feature. The way I implemented the options is that the ARGV array is actually parsed first for all options and then removes the options before going on to parse the find, replace, and filename arguments. This means that your options can go anywhere on the command line so long as they start with a -.

This presents 1 problem, a workaround, and a question for users. Using the second form of usage, where the find and replace portions are separate argument if your regex or replacement text starts with a “-” the script will interpret it as an option. You can avoid this by using the s/find/replace/ usage (or putting the regex in /regex/ format, which is allowed). But really this boils down to deciding whether or not I am being too liberal with my command line arguments. Since this is a very big fringe condition with a workaround I am going to allow options to be placed anywhere, allowing you to bring up the last command in bash with the up arrow and adding an option to the end of your rr command (like the new -m) to repeat your last command with an option much easier.

rr is always free, Try It Out:
rr - Current Version Download
rr-changelog.txt - Click Here

The date command on Unix displays or sets the system date or time. There are a variety of formatting options available.

$ date +”%m”

displays the month(01 to 12)

$ date +”%B”

gives the full month (e.g. January)

See the link for details.

I needed to get the abbreviated last month for one of my scripts. (e.g Nov). It seems that GNU date allows us to use the command as such :

$ date -d”1 month ago”

Sat Dec 1 12:36:42 MST 2007

So, I could get the abbreviated month by saying

$ date -d”1 month ago” +”%b”

It worked fine yesterday. But today(31 Dec) it says that the last month is Dec. When we say “1 month ago” , it tries to look for 31 Nov, and then corrects the date to 1 Dec. That doesn’t work for what I need.

So here is what I did

month=$(date +”%m”)
if((${month}==1));then
month=12
else
let month=${month}-1
fi
last_month=`date +”%b”`

I get the numeric value of the current month and subtract one . In the last step I make a dummy date with the month I calculated and then use “%b” to get the abbreviated last month.



Categories

Site Directory

Top Web Hosts

1.  
StartLogic Review
2.  
PowWeb Review
3.  
Just Host
4.  
1&1 Hosting
5.  
Hostmonster Review
6.  
Yahoo Review
7.  
IX Web Review
8.  
Hostgator Review
9.  
iPowerWeb Review
10.  
Dot5 Review
-   
Go Daddy Review
-   
Network Solutions Review

Blogroll

Powered by Technorati