From d02519bbd093bc027fa2cea86bfea436f67ef147 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Mon, 24 May 2021 15:01:57 +0200 Subject: [PATCH] add script to symlink to student numbers in current directory --- local/bin/subgit-symlinks | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 local/bin/subgit-symlinks diff --git a/local/bin/subgit-symlinks b/local/bin/subgit-symlinks new file mode 100755 index 0000000..36551f3 --- /dev/null +++ b/local/bin/subgit-symlinks @@ -0,0 +1,14 @@ +#!/bin/sh + +# lines of form: +# Givenname Last Name (student number) +LIST="${LIST:-/data/courses/students.list}" + +while read line; do + name="${line% (*}" + number="${line%) *}" + number="${number#* (}" + if [ -e "$number" ]; then + ln -s "$number" "$name" + fi +done < "$LIST"