Posts

Showing posts with the label scripts

Zenity.

Image
Many programming languages have some way of coding a graphical interface. Some languages like Python have special bindings (PyGTK, PYQT, etc.) and others, like Visual Basic, have their own commands for designing GUIs. As a result, many shell-script writers probably wish there were something like that for shell scripts. Well, there is a special way to code a GUI for scripts in the script itself. A special program called "Zenity" can be used in scripts to make GTK+-based windows. Zenity is used like other commands in a script with parameters and such. NOTE: Readers should have an understanding of shell scripting to fully grasp this article. Although, knowing how to script is not entirely necessary. Obviously, the script writer would make a script as usual. Now, the programmer can add Zenity commands or replace echo and read commands with windows that perform the same function. The basic usage of Zenity is like this - zenity --info --text="Something import...

Extracting data to a table.

Image
More than one way to skin a cat. # just a thought IFS=’%’ line=” [173]Virginia                          3-5 5-7 310 289 5-2 0-5 Lost 1″ a=`echo $line | cut -c8-28` b=`echo $line | cut -c29-31` c=`echo $line | cut -c33-35` d=`echo $line | cut -c38-40` e=`echo $line | cut -c42-44` f=`echo $line | cut -c46-48` g=`echo $line | cut -c51-53` h=`echo $line | cut -c56-61` echo “<html>”> somefile.html echo “<body>”>> somefile.html echo “<table border=1>”>> somefile.html  echo "<tr><td>School</td><td>W-L</td><td>W-L</td><td>PF</td><td>PA</td><td>Home</td><td>Away</td><td>Current streak</td></tr>" >> somefile.html echo “<tr><td>$a</td><td>$b</td><td>$c</td><td...