Recording and assessment on the Linux commandline

I have an Asus Eeepc that I take to school every day. I use the default Xandros Linux Operating System that was on it when I bought it, although I use icewm without the Asus tabs and icons.

One great thing about the Eeepc running the default Linux configuration is that the computer boots up really fast. I can leave it turned off and its quick to turn on when I need it. I use the commandline for recording observations of students or logging information for assessment purposes. Opening a terminal window is a lot quicker than opening up Open Office and navigating to a particular student’s file. I have set things up so that I have a very fast and simple way of logging student’s progress.

By writing a student’s name at the command prompt and pressing the ‘Enter’ key I can write my entry for their file. When finished I press ‘Enter’ and then the ‘Control’ and ‘C’ combination. My method adds time/date-stamped information to students’ files.

I have added extra repositories following the wiki at eeeuser.com. I think the Tee program was not in the Asus repository, so if you want to do this on the Eee you will probably need to enable extra repositories first.

After the extra repositories are enabled you can install Tee. Tee is a program that basically takes what you type into a terminal and puts it into a file. The program Echo can do the same thing and should already be installed; for instance the following command will append the words ‘hello world’ to a pre-existing file called test.txt:

echo “hello world” >> test.txt

However we will use Tee because if invoked as part of a sequence of commands it will prompt us for input, which is necessary for this recording method to work. So we’ll install Tee:

sudo apt-get install tee

We need to make blank files for each of the pupils records to go into. I want them to be located at /home/user/somefolder/assessment/ (NOTE: if you are using the Eee and want your files to be inside the ‘My Documents’ folder you will need to tell the terminal to ignore the annoying space in the folder name by using a backslash: ‘home/user/My\ Documents/etc…).
Make the new ‘assessment’ directory inside pre-existing ’somefolder’ directory:

mkdir /home/user/somefolder/assessment

Enter the new directory:

cd ~/somefolder/assessment

Make a blank file for each student called ’studentname.txt’:

touch student-a.txt student-b.txt student-c.txt

Change back to your home directory:

cd

Now we have the files in place we need to write the commands sequences that will add information to them.

After each entry in a student’s file I want an empty line followed by the current date and time, and then my new entry on a new line. For this to happen we will use a sequence of three programs: Echo, Date and Tee.

We will create an alias ( the Alias program uses user-defined names as shorthand for programs or command sequences instead of the full versions, thus saving time and making things easy to remember) for each student so that by writing their name at the command prompt the command sequence will append the new information to their individual file.

I used the hidden file ‘.bash_aliases’ to list my aliases. If this file does not exist (but is referenced in a script inside your ‘.bashrc’ file) you can make it yourself, and remove the comment (#) marks relating to it in your ‘.bashrc’ file, using your choice of text editor. This will mean that when the terminal is opened in future it will load your aliases. Otherwise add your aliases wherever your system wants them, for example inside ‘.bashrc’.

Assuming you are in your home directory…To see what relevant files you have by listing files including hidden files that contain the string ‘bash’:

ls -a | grep bash

Use a text editor to add your aliases with the command sequence for each student. In the following case the student is called ’student-a’.:

alias student-a=’echo ” ” >> /home/user/somefolder/assessment/student-a.txt && date >> /home/user/somefolder/assessment/student-a.txt && tee -a /home/user/somefolder/assessment/student-a.txt’

Copy and paste your version of the above for each student. For each instance of the name ’student-a’ change it to ’student-b’ etc. The code ‘alias name=’command” defines an alias. Echoing nothing gives a blank line. Date prints the current date and time. For echo and date ‘>>’ appends the information to the specified file. The symbols ‘&&’ mean to do the command at right if the command at left is successful. Using Tee with the ‘-a’ option appends what you enter at the commandline to the specified file instead of overwriting it or making a new file.

After you edit ‘.bash_aliases’ (or ‘.bashrc’) you should reload the file(s) in question so your aliases are available for you to try out right away. To reload ‘.bash_aliases’:

. .bash_aliases

Try it out. Type a student’s name and press “Enter’. Write something. Its a good idea to make the first entry for each student show their name so you don’t get confused when the files are printed off and have no mention of who you’re talking about! When you’ve finished press ‘Enter’ and then ‘Control and C’ together to exit the Tee program. Check to see that it worked:

cat ~/somefolder/assessment/the-student’s-name.txt

Its taken a little while to set up, but now you have a very quick way to enter information in your student’s files. I made a terminal window open automatically each time I turn on the computer by adding an entry to my ‘.icewm/startup’ file.