Linux Blog

tweeting from the command line

Filed under: Shell Script Sundays — TheLinuxBlog.com at 12:25 pm on Sunday, June 29, 2008

This is a subject that has been covered time and time again but I don’t think that it will hurt one more time. Twitter is a very popular “Microblogging” site where you can constantly change your status to let those who “follow” you know what you are doing. Since I just signed up for twitter for The Linux Blog I figured I’d write this post on how I update my twitter feed. While I’m at it I might as well invite you over to my feed URL: http://twitter.com/linuxblog

So here is the script:

#!/bin/bash
echo "Enter Tweet: ";
read inputline; TWEET="$inputline";
curl -u user:password -s -F status="$inputline" http://twitter.com/statuses/update.xml http://twitter.com/account/end_session

This is a very basic twitter script, it does no error checking and probably doesn’t escape characters properly. None the less it works. The part that gets input from the shell is the following line:

read inputline; TWEET="$inputline";

If you’d like more information on how this works read this article: Shell Script to get user input

Curl is used to send the data to Twitter, to view curl tutorials and how-to’s visit the Curl Man Page which has a wealth of information at the bottom.

Until next time, happy tweeting!

Sorting lists with Sort

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 11:11 pm on Wednesday, June 4, 2008

There comes a time when it is useful to know how to sort lists. Thankfully using open source software sorting text files can be very easy.

This example shows how to sort a file alphabetically using the sort command. I assume that you have a text file in mind so I will skip the creation of that. There are two ways to sort the file with the sort command. The first being the preferred method but not always suitable.

sort [textfile]
 
cat [textfile] | sort

That’s it! The second method can be useful if you would like to do any thing special, for example searching with grep, using cut or sed for data extraction or just out of convenience. Check out the man page for sort for more information on all of the options!

The Linux Blog – More May Updates

Filed under: The Linux Blog News — TheLinuxBlog.com at 6:30 am on Monday, May 26, 2008

If you read my last Linux Blog update post you will have noticed that I added links to the man pages that have examples of how to use that command. This blog post is to tell you that I have implemented that feature but the reverse. In other words, when ever you view a Linux Blog post that I have written you will see links to the man pages of the commands used in that post and from there you can navigate to other examples of how to use that command. I hope that this feature is a useful one for The Linux Blog readers, if it is let me know and if it isn’t tell me you like it any way. I’m going to be adding more man pages soon since I have found that not all man pages that I have are on The Linux Blog. I will also be adding more man page sections for the ones I missed out.

Now that I have implemented that function the only thing I really have to do is have the ability to add, update and manage man pages on the fly.

More news
I have also been corresponding with the guys over at Wakoopa about working on a client to their web application for Linux. I will let you know more information as it becomes available. I am very interested in writing a client for their service and would love for Linux users to be able to join in on the fun!

Thats all for now,

– Owen

Man Page Not Found

Filed under: The Linux Blog News — TheLinuxBlog.com at 6:58 pm on Sunday, March 16, 2008

I’ve added this post because the Linux Man Pages that I have added to this site need to be directed some where when a man page is not found. I stumbled upon the problem after I saw Google trying to index pages that did not exist. My guess is that there are links within the man pages section that are bad.

I will be monitoring this page to see where the hits to this page are coming from but if you followed a link here from the Linux man pages section then I would really appreciate a comment with which page you ended up here from and I will fix the problem.

Thanks in advance,

-Owen.

Linux Man Pages Added

Filed under: The Linux Blog News — TheLinuxBlog.com at 9:35 pm on Saturday, March 15, 2008

I’ve just added a section to this site that I have been working on for a while.

Basically I’ve been wanting a place to store the man pages online. So, I wrote a little script that would let me do it. All I have to do now is write a search for it and then some small little tweaks.

Let me know if you find the man page section useful. It can be found under the pages section on the right hand column of this site or you can access it directly by going to http://www.thelinuxblog.com/linux-man-pages/

« Previous Page