Stop long commands wrapping around and over-writing itself in the Bash shell

2009-10-12 1 min read Bash

Stop long commands wrapping around and over-writing itself in the Bash shell

shopt -s checkwinsize

add the command either in /etc/profile or ~/.bash_profile so that this is available to your shell.

* View this command to comment, vote or add to favourites * View all commands by settermjd

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/_0MaJbX9Jvo/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell">http://feedproxy.google.com/~r/Command-line-fu/~3/_0MaJbX9Jvo/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/08/22/reading-multiple-files-with-bash/">Reading Multiple Files with Bash (slumpedoverkeyboarddead.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/75f993fa-150b-4fdb-9cf5-d69437b87521/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e13.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading

Script to generate a html file with link to all files in directory

2009-09-26 1 min read Bash GNOME Linux

ls -1 |awk -F&#8221;.&#8221; '{print  &#8221;

&#8221;,$2,&#8221;.&#8221;,$3,&#8221;

&#8221; ;}&#8217; > index1.html

And if you want to do it recursively

ls -1R |awk -F&#8221;.&#8221; '{print  &#8221;

&#8221;,$2,&#8221;.&#8221;,$3,&#8221;

&#8221; ;}&#8217; > index1.html

Database of vulnurability at milw0rm.com – udpate and makeindex with cron.

2009-09-08 1 min read Bash Uncategorized

I am quite regular visitor of milw0rm and generally try to keep up with the vul&#8217;s. For doing this I wrote a small scripts rather set of scripts to keep myself update.  Here&#8217;s what we are going to do:

  1. Get the latest tar from the site.

  2. Extract it.

  3. Make the index

  4. Have a shortcut to search the index.

Download the attached files for the first 2 points. <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/makeindex-milw0rm.sh">makeindex-milw0rm and <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/udpate-milw0rm.sh">udpate-milw0rm

Continue reading

bash tutorial for begineer and experienced.

2009-07-20 1 min read Bash Learning

I having been looking for something like this for sometime. Found <a href="http://beginlinux.com/desktop_training/comm/shells/232-bash" target="_blank">this while searching.

A very good thing about this tutorial is its comprehensiveness and the details. A lot of examples are gives which too are quite useful.

Get you ip address like whatismyip.com

2008-11-30 2 min read Bash Uncategorized

For last couple of days, I was thinking of putting this. I was thinking of some way to get the IP address of the client directly rather than going through some site or parsing the content. So <a href="http://amit-agarwal.co.in/mystuff/getip.php" target="_blank">here it is.

Now the trick here is simple. There are two ways to get the IP address of the client in the php script and thus a simple script like the below would capture both of them.

Continue reading

parse and paste text

0001-01-01 1 min read Bash

Lot of times, I copy the text but before pasting want to remove a word or make some other changes or add “wget” to the URL, quite common. So, I came up with this alias

replace='echo $(xclip -i)|sed 's/text//'|xclip -o'

and this depends on xlip, which you can install with

 

dnf install xclip
Newer posts