Print all environment variables, including hidden ones

2010-11-09 2 min read Bash Fedora Linux

Print all environment variables, including hidden ones

  <td>
    <div class="text codecolorer">
      for _a in {A..Z} {a..z};do _z=${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv
    </div>
  </td>
</tr>
1

This uses some tricks I found while reading the bash man page to enumerate and display all the current environment variables, including those not listed by the ‘env‘ command which according to the bash docs are more for internal use by BASH. The main trick is the way bash will list all environment variable names when performing expansion on ${!A*}. Then the eval builtin makes it work in a loop.

Continue reading

cURL – Tutorial

2010-09-15 1 min read Bash Fedora Linux

Here are linkw to two nice tutorials on curl and how to use curl to login before we try to fetch a page. Hope you find them useful.
http://curl.haxx.se/docs/httpscripting.html

http://www.youtube.com/watch?v=XcgQUsorF_8

http://scriptasy.com/php_11/tutorial-curl-login_44.html

Enhanced by Zemanta

15 (More) Awesome Conky Configurations

2010-09-13 0 min read Fedora Linux
\"A
Image via Wikipedia

15 (More) Awesome <a class="zem_slink" title="Conky (software)" rel="homepage" href="http://conky.sourceforge.net/">Conky Configurations You may have already seen our list of awesome Conky scripts or configurations, and perhaps applied or used some of them on your own <a class="zem_slink" title="Linux" rel="homepage" href="http://www.kernel.org/">Linux desktop. Since that collection was quiet popular, I decided to scour the web once again to gather more Conky scripts that I could share with all of you. Now, here is another list of some of the most excellent and unique conky configurations that you could freely use. Enjoy!

Continue reading

Use the last command\’s output as input to a command without piping and bind to it to a key sequence in bash.

2010-09-01 1 min read Fedora Linux Uncategorized

Use the last command&#8217;s output as input to a command without piping and
bind to it to a key sequence in <a class="zem_slink" title="Bash (Unix shell)" rel="homepage" href="http://tiswww.case.edu/php/chet/bash/bashtop.html">bash.

  <td>
    <div class="bash codecolorer">
      &nbsp;<span class="kw3">bind</span> <span class="co3">\'</span><span class="st0">"\\C-h"</span>: <span class="st0">"\\<span class="es5">`fc\\ \\-s\\`</span>"</span><span class="co3">\'</span>
    </div>
  </td>
</tr>
1

My comment : fc is the fix command of the bash builtin.
This is similar to using `!!` or

Continue reading

tee to a file descriptor

2010-08-13 1 min read Bash Linux

tee to a file descriptor

1
$ tee >(cat &#8211; >&2)

the tee command does fine with file names, but not so much with file descriptors, such as &2. This uses process redirection to tee to the specified descriptor.

In the sample output, it’s being used to tee to stderr, which is connected with the terminal, and to wc -l, which is also outputting to the terminal. The result is the output of bash –version followed by the linecount

Continue reading

when you press f9 'paste' is on , press f9 again and 'paste' is off, and so forth (works in insert-mode and command-mode)

2010-08-02 1 min read Bash Linux

<a class="zem_slink" title="Vim (text editor)" rel="homepage" href="http://www.vim.org/">vim&#8217;s pastetoggle: when you press f9 &#8217;paste&#8217; is on , press f9 again and &#8217;paste&#8217; is off, and so forth (works in <a class="zem_slink" title="Insert key" rel="wikipedia" href="http://en.wikipedia.org/wiki/Insert_key">insert-mode and command-mode) $ nmap :set paste!:set paste? Sets as paste toggle, with visual confirmation of state

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

commandlinefu.com

by David Winterbottom (codeinthehole.com)

Continue reading

Over 50 Free, Must-Have Open Source Resources

2010-07-27 0 min read Linux
\"no
Image via Wikipedia

OStatic: &#8221;n this post, you&#8217;ll find an updated set of more than 45 collections and resources. Hopefully, you&#8217;ll find something to learn from here, and the good news is that everything found in this post is free.&#8221;

<a class="zem_slink freebase/guid/9202a8c04000641f800000000003f3a0" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL: <a href="http://linuxtoday.com/news_story.php3?ltsn=2009-11-23-003-35-RV-SW">http://linuxtoday.com/news_story.php3?ltsn=2009-11-23-003-35-RV-SW<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://technology.johnsamuel.in/main/index.php/2009/10/25/bit-ly-more-than-just-a-url-shortener/">bit.ly: More than just a URL shortener (technology.johnsamuel.in) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/01000062-d486-42d2-bd70-1cb729684b22/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b18.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading
Older posts Newer posts