LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

[bash] Continue to attempt running a command until it succeeds, or a specified number of tries.

Posted 08-12-2014 at 10:56 PM by goumba

Inspired by the dsc in his post, http://www.linuxquestions.org/questi...og.php?b=36164, I decided to try and get the number of tries part working, and here's what I came up with:

Code:
#!/bin/bash                                                                     
set -x # remove/comment when you no longer wish to see debugging output

case $1 in
    [0-9]*)
        max=$1
        # shift so that $@ only contains the command we're interested
...
Member
Posted in bash scripting
Views 157 Comments 6 goumba is offline
Old

ExLight Linux Live DVD with Enlightenment 0.19 :: now based on Ubuntu 14.04.1

Posted 08-12-2014 at 12:20 PM by exton (Exton's Blog)
Updated 08-12-2014 at 12:33 PM by exton

ExLight 14.04.1 Linux Live DVD build 140812 is based on Ubuntu 14.04.1 LTS (alias Trusty Tahr, released July 25, 2014). The Desktop Environment is Enlightenment 0.19 (Beauty at your fingertips) installed from source. Kernel 3.16.0-5-exton is used. (Kernel.org's kernel 3.16.0-rc6). Program content: AbiWord, Nautilus, SpaceFM, Firefox, Gimp and GParted. Also all necessary additions in order to install programs from source. Study the full program LIST. All programs have been updated to the latest available...
ExTiX Admin
Views 768 Comments 0 exton is offline
Old
Rating: 3 votes, 5.00 average.

Windows PowerSh**

Posted 08-12-2014 at 10:40 AM by rocket357 (Musings on technology, philosophy, and life in the corporate world)
Updated 08-12-2014 at 11:15 AM by rocket357

grep is such a simple concept. You have a stream of text lines, and you look for lines in the output that match a pattern. Really, really simple.

Take the following, for example:

some-command | grep 'pattern'

I know this is difficult to understand because it's overly complex, but that's how things work on *nix.

Try doing that on PowerShell. You end up with something like:

(some-command|out-strings -stream) | select-strings...
Member
Posted in Uncategorized
Views 350 Comments 2 rocket357 is offline
Old

Member Response

Posted 08-11-2014 at 06:23 PM by onebuck

Hi,

Been a while since I made a blog entry. Lot has happened since the initial entry. I am now a LQ moderator that takes up time for my duties. I do enjoy helping other LQ members whenever possible. I have sold the farm therefore the horses had to find a new home and I moved to town to live in a historical home we had to purchase.

Love the convenience of living in town but miss the solitude of the country. I lost all my storage (barn) & workshop. I am in the process...
Moderator
Posted in Uncategorized
Views 346 Comments 0 onebuck is offline
Old

[bash] "keep trying" command, even if exits with error, for at least 10 times

Posted 08-08-2014 at 10:40 PM by the dsc (linux-related notes)
Updated 08-08-2014 at 10:42 PM by the dsc
Tags bash

A script that tries to run a given arbitrary command N times, or until it exits with success. The commented parts are aborted attempts to make it figure whether the first parameter is a number instead of a command, and that would be used as the maximum number of attempts. Something went wrong, sometime I'll try to figure it out.

Quote:
#!/bin/bash
#input="$@"
# this program is stupid. It's declared to be in public domain by its author, who whishes to remain anonymous
...
Member
Posted in Uncategorized
Views 429 Comments 3 the dsc is offline

  



All times are GMT -5. The time now is 10:07 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration