Linux command to repeat a string n times - Super User

2010-07-20 1 min read Bash Linux

I was working on something and needed to output the string n times. I have required this even to print a line with ’-’ or ’=’ but this time I badly wanted it in bash. So I searched google and found this:

printf ”Amit Agarwal%.0s” {1..5}

Explanations and other examples: <a href="http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times">http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times<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.rateitall.com/i-3177235-flat-rate-us-terminations.aspx">1 reviews of Flat-Rate US Terminations (rateitall.com) <li class="zemanta-article-ul-li"><a href="http://www.brighthub.com/computing/linux/articles/75743.aspx">Top Linux GUI (brighthub.com) <li class="zemanta-article-ul-li"><a href="http://www.gnu.org/software/emacs/tour/">A guided tour of Emacs (gnu.org) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e6.png" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">

Continue reading

gnomecc color scheme - my favourite.

2010-07-11 1 min read Fedora

my favourite <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/gtkrc-2.0-gnome-color-chooser">gtkrc-2 file.

Snapshot of how it looks.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/desktop.jpg"><img class="size-medium wp-image-796" title="desktop" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/desktop-300x187.jpg" alt="desktop" width="300" height="187" /><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e1.png" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">

Solved -- Errors with afraid-dyndns in Goddard (Fedora 13)

2010-05-06 2 min read Fedora Learning Linux

Since I updated to the <a class="zem_slink freebase/en/fedora" title="Fedora" rel="homepage" href="http://fedoraproject.org/">Fedora 13, I was getting error from the <a class="zem_slink freebase/en/dynamic_dns" title="Dynamic DNS" rel="wikipedia" href="http://en.wikipedia.org/wiki/Dynamic_DNS">Dynamic DNS client for afraid. I was not getting enough time to fix this, so finally I decided to fix this in the night itself πŸ™‚

Problem:
On running

afraid-dyndns

I was getting the error:

Entity: line 100: <a class="zem_slink freebase/en/parsing" title="Parsing" rel="wikipedia" href="http://en.wikipedia.org/wiki/Parsing">parser error : Opening and ending tag mismatch: br line 99 and div

Continue reading

prepend to a file with sponge from moreutils

2010-03-16 1 min read Linux

<a href="http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html">A few weeks I wrote about a tool, which helps you easily prepend to a file. I submitted prepend to moreutils and Joey was kind enough to point out this could be done with `sponge&#8217;.? sponge reads standard input and when done, writes it to a file:
Probably the most general …<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://helpdeskgeek.com/linux-tips/crontab-howto-tutorial-syntax/">Automating Tasks in Linux Using Crontab (helpdeskgeek.com) <li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/progrium/sxsw-evented-web">How WebHooks Will Make Us All Programmers (slideshare.net) <li class="zemanta-article-ul-li"><a href="http://almirkaric.com/2010/01/07/debugging-python-multiprocessing/">Debugging python (multi)processing (almirkaric.com) <li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/royzimmer/you-can-do-it-start-using-perl-to-handle-your-voyager-needs">You Can Do It! Start Using Perl to Handle Your Voyager Needs (slideshare.net) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/b2b2afad-1679-46ab-831c-90ae0cc4d30f/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b14.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

Perl script to create csv files with a pattern – Generic script.

2010-01-19 1 min read Learning Linux Perl

I was having a really bad day and needed a quick solution to create some csv files. And this I needed to do for multiple data kinds and patterns, so I created this small script to do the job for me…

#Number of rows required in the output.

$rows = 100;

#The config and the output file

open (CF_FILE, &#8221;<Config.test&#8221;);
open (OUT_FILE, &#8221;>test.csv&#8221;);

#β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
# No need to change anything below this.
#β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

Continue reading
Newer posts