bash – expand shell variables ( bash bug resolved )

2015-08-17 1 min read bash
As you would have noticed in the recent versions of bash, expansion does not work properly when expanding directory names. So, for something like this cd $varname if you press tab, then variable name does not expand properly. If this is something that is bothering you then you can now add the following in your bashrc and revert to older behaviour: shopt -s direxpand Hope this helps you.

colors in bash -- script to display all the possible colors.

2010-06-06 3 min read bash Fedora Linux
If you wanted to have colors in the bash output (including the colors in PS1-4), don’t you keep wondering how the color code would look on the terminal. So, I wrote this small script to show the complete color codes. This is how the output would look: And here is the script: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Continue reading

let a cow tell you your fortune

2010-06-03 1 min read bash Linux
Here\’s something that I saw on commandlinefu yesterday. That sent me thinking about some command to have the cow file picked randomly 🙂 So, here\’s the original command from the commandlinefu: let a cow tell you your fortune 1 <td> <div class="text codecolorer"> $ fortune | <a class="zem_slink freebase/en/cowsay" title="Cowsay" rel="homepage" href="http://www.nog.net/%7Etony/warez/cowsay.shtml">cowsay</a> -f tux </div> </td> </tr> </table> Let

Checking the links to your site (from affiliates) using cron and bash script.

2010-05-27 2 min read Fedora Learning Linux Uncategorized
If you have some affiliate links and are concerned about their presence then you can setup <a class="zem_slink freebase/guid/9202a8c04000641f80000000045c9c5b" title="Cron" rel="wikipedia" href="http://en.wikipedia.org/wiki/Cron">cron to check the links for you regularly. For this you need a very simple script (as below) and a cron entry (example further down). #!/bin/bash – #=============================================================================== # FILE: checklinks.sh # USAGE: ./checklinks.sh # DESCRIPTION: Check if the links exists on affiliate sites # OPTIONS: — # REQUIREMENTS: — Continue reading

vim - get mappings from the help tex files available with the scripts.

2010-05-27 2 min read Fedora Learning Linux Vim Tips
Here is a simple script that will show all the vim mappings from the tex file (help file that comes with the vim scripts). This will prove to be very useful in usin gthe mappings 🙂 #!/bin/bash – #=============================================================================== # FILE: get_mappings_from_tex_for_vim.sh # USAGE: ./get_mappings_from_tex_for_vim.sh # DESCRIPTION: Get the mappings from tex file # OPTIONS: — # REQUIREMENTS: — # BUGS: — # NOTES: — # AUTHOR: <a class="zem_slink" title="Amit Agarwal" rel="self" href="http://blog. Continue reading

Script to download all the related videos from youtube with youtube-dl

2010-05-17 2 min read Fedora Linux Uncategorized
Lets cut the long discussion <a class="zem_slink freebase/en/short_subject" title="Short film" rel="wikipedia" href="http://en.wikipedia.org/wiki/Short_film">short and directly give you the script. The script is combination of all the posts that I did in the past about youtube <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">downloads. You need to copy all the <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL&#8217;s in a file called &#8221;~/youtube.urls&#8221; which you want to be downloaded. Or if you need to donwload the related videos, then save the html of the page and give it as the first argument for the script. Continue reading