Blog Detail

Linux and unix shell scripts container

Linux and unix shell scripts container

http://linuxscripting.blogspot.com/

Scripts, Manuals, Tips, Tricks and Hints in using and administering Linux, Solaris, BSD, Unix. Shell scripts, Bash, sh, zsh, ash, csh, sed, awk, man, info, perl, ruby, php, python, cgi, programming.

subscribe Recent Posts

  • Seconds to hours and minutes

    Posted on Friday March 6th, 2009 at 13:27 in bash, shell scripts

    This program format an arbitrary number of seconds into hours and minutes: #!/bin/bashseconds=0echo -n "Enter number of seconds > "read secondshours=$((seconds / 3600))seconds=$((seconds % 3600))minutes=$((seconds / 60))seconds=$((seconds % 60))ech...

  • Simple array usage in Bash

    Posted on Saturday February 28th, 2009 at 08:26 in bash

    #!/bin/basharray=(one two three four [5]=five)echo "Array size: ${#array[*]}"echo "Array items:"for item in ${array[*]}do printf " %s\n" $itemdoneecho "Array indexes:"for index in ${!array[*]}do printf " %d\n" $indexdoneecho "Array items an...

  • Fifth basic front end with dialog/Xdialog - Building a Gauge

    Posted on Saturday February 28th, 2009 at 08:19 in bash, shell scripts, dialog xdialog

    A gauge based on dialog can be used to indicate progress of your program. Building a gauge is slightly tricky. Look at the following example: #!/bin/shDIALOG=${DIALOG=dialog}COUNT=10(while test $COUNT != 110doecho $COUNTecho "XXX"echo "The new\n\mes...

  • Fourth basic front end with dialog/Xdialog - Radiolist and Checklist

    Posted on Saturday February 28th, 2009 at 08:12 in bash, shell scripts, dialog xdialog

    Radiolists and checklists can be programmed just like menus. A simple radio list example is given below. #! /bin/shDIALOG=${DIALOG=dialog}tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$trap "rm -f $tempfile" 0 1 2 5 15$DIALOG --backtitle "...

  • Third basic front end with dialog/Xdialog - building menu

    Posted on Saturday February 28th, 2009 at 08:04 in bash, shell scripts, dialog xdialog

    Try the following program both in console and X (after changing dialog to Xdialog as before): #!/bin/shDIALOG=${DIALOG=dialog}tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$trap "rm -f $tempfile" 0 1 2 5 15$DIALOG --clear --title "My favor...

  • Second basic front end with dialog/Xdialog

    Posted on Saturday February 28th, 2009 at 07:53 in bash, shell scripts, dialog xdialog

    The following script reads a string you input and prints it back.#!/bin/shDIALOG=${DIALOG=dialog}tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$trap "rm -f $tempfile" 0 1 2 5 15$DIALOG --title "My input box" --clear \ --inputbox "Hi, t...

Comments & Reviews

There is no rating for this blog because there are no comments yet.

Post A Comment/Review

* Your IP is being logged.
* Your e-mail address is used only for verification purposes only and will not be sold, or shown publicly.
* No HTML tags allowed
* DO NOT use the Comments/Reviews to promote your own site.

Name: or Login
E-mail:
Rating:
Verify: Spam Protection: sum of 2 + 3
Comment:
  Remember Information