[Sussex] Round up of last night

Steve Dobson steve at dobson.org
Fri Nov 30 10:45:40 UTC 2007


Hi Mooters

First a big thank you to Gavin for his talk on "Life without X".  As a
long time command line junkie it is always nice to come across a new
commands.  Gavin introduced me to sc(1) a text-based spreadsheet with
VI-like key bindings, well that's how it describes itself.  

Of course I had to install and play with it.  I entered a very simple
test spread sheet, saved it to a file and then looked at the file
produced.  No binary encoding here, it's a nice and easy to read ASCII
file:
	# This data file was generated by the Spreadsheet Calculator.
	# You almost certainly shouldn't edit it.

	let A0 = 45
	let A1 = 23
	let A2 = A0+A1
	goto A2 A0

I ignored the comment on the second line and hacked the file:
	let A0 = 45
	let A1 = 23
	let A2 = A0+A1

	let C0 = 2
	let C1 = 4
	let C2 = C0+C1+A2

	goto A0 A2
	goto C0 C2

This didn't produced any changes to spreadsheet so I changed both "goto"
lines with:

	goto A0 C2

Bingo.  I now have a spreadsheet that I can easily generate from a
script!

I would also like to thank Richie and the other for introducing me to
screen(1).  Very useful for people who remotely log in to systems to
maintain them.  screen(1) creates a "detachable" command shell than to
can later connect to from a different login session.

Demo:

1) Ctrl-Alt-F1 to get a old fashioned, no graphical login prompt and
then log in as normal.

2). Determine the size of the screen:
	$ echo $COLUMNS
Will get you the terminal's width in characters, mine is 80.
I then use a simple text editor (e.g. nano) to put some line numbers up
and counted the lines - 24 in my case.

3).  Switch back to your graphical environment (normally Alt-F7, but it
may vary on your distro, so if it isn't on ALT-F7 just work your way up
from Alt-F2 until you find it.

3). Open up a graphical shell and make it the same size as the terminal.
Gnome is nice to me and when I resize a gnome-terminal it tells me the
size in rows and columns. If your desktop does not then just use the
same method above to work it out.

4). In the graphical command shell run the screen command:
	$ screen
  I got it's welcome screen and GNU license text as recommended by the
GPL, Richie said some versions don't do that they just come straight
back with a command prompt so it appears nothing has happened.  Hit
RETURN if you get the welcome screen and you just get another prompt -
nothing appears to have changed but it has.  :-)

5).  Run a demo command.  I used bb(1) here to really see how well
screen(1) worked but any command will do.  If you are going running
bb(1) first type:
	$ unset DISPLAY
otherwise bb with create it's own X11 window and you don't want that,
you want it to run in the same terminal window that you ran it from.
Let it run for a while and then detach from screen(1) with Ctrl-A D.
You should see a "[detached]" message.  It looks like you've kill the
bb(1) command but this is where the fun starts. :-)

6). Switch back to your virtual terminal (Ctrl-Atl-F1) and enter the
command:
	screen -r
to attach to command shell you created in your graphical window in  step
4 and continue where you left off.

Now that is cool!

Other matters:

VI
==

Jan's moot will be about vi(1) the love it or hate it editor - there
just no middle ground.  I have wanted to do such a talk for a while but
I didn't think there was enough interest.  As several people last night
said that they would like to get to know vi better I have decided to go
ahead.

The talk will not just be a procession through the various commands.  I
will show them but they will be quickly skipped over.  The best way to
learn vi is to use it.  So just print yourself one of the vi quick
reference guides and sit there and use it for a few days.

For the talk I plan to show where vi came from and what it can do.  The
idea being at the end that you still won't really know how to use vi,
but you will have pointers to the commands so which the help of a book
or the web you can then learn how to do it for yourself.

Good Omens
==========
Vicky, this is the book Richie and I recommended.
   http://en.wikipedia.org/wiki/Good_Omens
The Wikipedia entry has the ISBN number so you can no go get it at your
favourite book seller, and I'm not pimping any seller here.  :-)

Steve
-- 
Steve Dobson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20071130/0d0fecb6/attachment.pgp 


More information about the Sussex mailing list