O'Reilly logo

Linux Shell Scripting with Bash by Ken O. Burtch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Script Basics

I was first introduced to computers when my high school purchased a shiny new TRS-80, Model I. The computer was installed in the library, free for anybody to use. I remember following the dog-eared manual and typing in my first BASIC program.

10 PRINT "KEN WAS HERE";
20 GOTO 10

When I ran the program, I was in for a surprise. Not only did the computer faithfully carry out my instructions over and over, but also the words scrolling up the screen formed a shifting pattern. When the screen became full, it scrolled to make room for more messages. If I changed the length of the message to a number that evenly divided into 64 (the TRS-80 had 64 character lines), the messages marched up the screen in neat columns. There was unexpected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required