Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 1b45104

Browse files
committedSep 18, 2018
codestyle for binary checking
1 parent 0fd1aa8 commit 1b45104

11 files changed

+32
-64
lines changed
 

‎antifmt.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ if [ -z "$*" ]; then
1616
exit 1
1717
fi
1818

19-
for cmd in unzip unrar 7zr bunzip2 gunzip unxz tar pdftotext
20-
do
21-
if ! command -v $cmd >/dev/null 2>&1
22-
then
19+
for cmd in unzip unrar 7zr bunzip2 gunzip unxz tar pdftotext; do
20+
if ! command -v $cmd >/dev/null 2>&1; then
2321
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
2422
exit 1
2523
fi

‎bsunzip.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
# unzip a brightspace-provided file, and split the index.html it contains over the subdirectories
44

5-
for cmd in unzip iconv
6-
do
7-
if ! command -v $cmd >/dev/null 2>&1
8-
then
5+
for cmd in unzip iconv; do
6+
if ! command -v $cmd >/dev/null 2>&1; then
97
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
108
exit 1
119
fi

‎collectplag.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@
1414
# ./antifmt.sh
1515
# ./groepjes.sh [ufsez][0-9]*
1616

17-
for cmd in tar
18-
do
19-
if ! command -v $cmd >/dev/null 2>&1
20-
then
21-
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
22-
exit 1
23-
fi
24-
done
17+
if ! command -v tar >/dev/null 2>&1; then
18+
echo "Who am I? Why am I here? Am I on lilo? tar is missing!" >& 2
19+
exit 1
20+
fi
2521

2622
dir="plag"
2723
for arg in "$@"; do

‎iching.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#! /bin/bash
22

3-
for cmd in curl
4-
do
5-
if ! command -v $cmd >/dev/null 2>&1
6-
then
7-
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
8-
exit 1
9-
fi
10-
done
3+
if ! command -v curl >/dev/null 2>&1; then
4+
echo "Who am I? Why am I here? Am I on lilo? curl is missing!" >& 2
5+
exit 1
6+
fi
117

128
url="http://www.thateden.co.uk/dirk/pred.php?ching1=$(($RANDOM%8+1))&ching2=$(($RANDOM%8+1))"
139

‎identify.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
# this script adds email addresses and student ids to folder names extracted
44
# from Brightspace, given a CSV file obtained via 'Enter Grades'
55

6-
for cmd in curl
7-
do
8-
if ! command -v $cmd >/dev/null 2>&1
9-
then
10-
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
11-
exit 1
12-
fi
13-
done
6+
if ! command -v curl >/dev/null 2>&1; then
7+
echo "Who am I? Why am I here? Am I on lilo? curl is missing!" >& 2
8+
exit 1
9+
fi
1410

1511
if [ -z "$1" ]; then
1612
echo "Usage: addraddr.sh spreadsheet.csv [dir1] [dir2] ... [dirN]" 1>&2

‎jarify.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
# convert a flat directory into a jar file
44
# - when run without arguments, convert the current directory
55
# - when run with argument, convert every mentioned directory
6-
for cmd in jar javac
7-
do
8-
if ! command -v $cmd >/dev/null 2>&1
9-
then
6+
for cmd in jar javac; do
7+
if ! command -v $cmd >/dev/null 2>&1; then
108
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
119
exit 1
1210
fi

‎mailto.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
# this sends the message in dir/file.txt to the addresses in dir/#address.txt
44

5-
for cmd in bsd-mailx iconv
6-
do
7-
if ! command -v $cmd >/dev/null 2>&1
8-
then
5+
for cmd in bsd-mailx iconv; do
6+
if ! command -v $cmd >/dev/null 2>&1; then
97
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
108
exit 1
119
fi

‎rgrade.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
# Start grading in a randomly chosen, ungraded submission folder
44

5-
for cmd in base64 gunzip
6-
do
7-
if ! command -v $cmd >/dev/null 2>&1
8-
then
5+
for cmd in base64 gunzip; do
6+
if ! command -v $cmd >/dev/null 2>&1; then
97
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
108
exit 1
119
fi

‎trialc.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#! /bin/sh
22

3-
for cmd in g++
4-
do
5-
if ! command -v $cmd >/dev/null 2>&1
6-
then
7-
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
8-
exit 1
9-
fi
10-
done
3+
if ! command -v g++ >/dev/null 2>&1; then
4+
echo "Who am I? Why am I here? Am I on lilo? g++ is missing!" >& 2
5+
exit 1
6+
fi
117

128
if [ -z "$1" ]; then
139
echo "usage: trialc.sh dir" 1>&2

‎verdeel.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ SUBJECT="`whoami` could not be bothered to configure SUBJECT"
2222
# this script takes care of the distribution of workload over
2323
# all the teaching assistants, after downloading the zip
2424

25-
for cmd in 7za mutt
26-
do
27-
if ! command -v $cmd >/dev/null 2>&1
28-
then
25+
for cmd in 7za mutt; do
26+
if ! command -v $cmd >/dev/null 2>&1; then
2927
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
3028
exit 1
3129
fi

‎wizard.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ exit
2222

2323
# configuration wizard for bb-scripts
2424

25-
for cmd in curl
26-
do
27-
if ! command -v $cmd >/dev/null 2>&1
28-
then
29-
echo "Who am I? Why am I here? Am I on lilo? $cmd is missing!" >& 2
30-
exit 1
31-
fi
32-
done
25+
if ! command -v curl >/dev/null 2>&1; then
26+
echo "Who am I? Why am I here? Am I on lilo? curl is missing!" >& 2
27+
exit 1
28+
fi
3329

3430
set -e
3531
cd "${0%/*}"

0 commit comments

Comments
 (0)
This repository has been archived.