~johanvandegriff/unix-shell-programming-revised-edition-programs

unix-shell-programming-revised-edition-programs/objects/add -rw-r--r-- 357 bytes
fc214385Johan Vandegriff added other old scripts, some newer ones too 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
cat $HOME/programs/objects/objects.txt
number=`cat objects.txt | cut -f1 -d' ' | tail -1`
number=`expr "$number" '+' '1'`
number=`printf "%4s" $number | tr ' ' '0'`
echo -n "ADD (object)  "
read object
echo -n "ADD (color)  "
read color
echo "$number $object	$color" >> $HOME/programs/objects/objects.txt
gedit $HOME/programs/objects/objects.txt