aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-07 14:01:30 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-07 14:01:30 +0000
commit1bd8c15d882fc0420de8956664eefbb2e0d54f42 (patch)
tree4318149985fd6107057af3af5c8d6feffbdc5e05
parent245d387c737ba4be367c08c022a39efe513f2059 (diff)
downloadrpm-helper-1bd8c15d882fc0420de8956664eefbb2e0d54f42.tar
rpm-helper-1bd8c15d882fc0420de8956664eefbb2e0d54f42.tar.gz
rpm-helper-1bd8c15d882fc0420de8956664eefbb2e0d54f42.tar.bz2
rpm-helper-1bd8c15d882fc0420de8956664eefbb2e0d54f42.tar.xz
rpm-helper-1bd8c15d882fc0420de8956664eefbb2e0d54f42.zip
keep /etc/shells sorted, thus enabling to ensure uniq entries
-rwxr-xr-xadd-shell5
1 files changed, 4 insertions, 1 deletions
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