From 1bd8c15d882fc0420de8956664eefbb2e0d54f42 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 7 Nov 2002 14:01:30 +0000 Subject: keep /etc/shells sorted, thus enabling to ensure uniq entries --- add-shell | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/add-shell b/add-shell index ea60c91..099bdaa 100755 --- a/add-shell +++ b/add-shell @@ -26,5 +26,8 @@ if [ ! -f $CFG_FILE ]; then > $CFG_FILE fi -grep -qv "^$shl$" $CFG_FILE && echo $shl >> $CFG_FILE +grep -qv "^$shl$" $CFG_FILE && \ + (cat /etc/shells;echo /bin/TSH) | sort | uniq > $CFG_FILE.new +[[ -f $CFG_FILE.new ]] && mv -f $CFG_FILE.new $CFG_FILE + exit 0 \ No newline at end of file -- cgit v1.2.1