Print all environment variables, including hidden ones

2010-11-09 2 min read bash Fedora Linux
Print all environment variables, including hidden ones 1 <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> 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. 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 Related articles by Zemanta {."zemanta-related-title"} How To Display Just The HTTP Response Code In CLI Curl (beerpla.net)

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. 1 <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> My comment : fc is the fix command of the bash builtin. This is similar to using `!!` or In bash 4.1 it seems you can bind directly to a shell command, but I&#8217;m 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. Continue reading
Older posts Newer posts