Finished exercise 1 and 2 on lab 8

This commit is contained in:
2013-12-28 14:55:26 +01:00
parent 656f1a0eb1
commit 3a13dae36a
9 changed files with 130 additions and 1 deletions

32
Labb8/ovning2_ver2.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Jack-Benny Persson
# LX13
# Exercise 2, lab 8 (make an advanced ls printout)
# Binaries
Awk="/usr/bin/awk"
# Variables
MyLs="myls.awk"
# Sanity check
if [ $# -ne 1 ]; then
echo "`basename $0` requires one argument"
exit 1
fi
if [ ! -x $Awk ]; then
echo "Can't execute $Awk"
exit 1
fi
if [ ! -r $MyLs ]; then
echo "Can't find file $MyLs"
exit 1
fi
# Main
ls -l $1 | awk -f $MyLs
exit 0