aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-12-22 21:39:36 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-12-22 21:39:36 +0000
commit6076e73d4dd62a7904bb5559de14f77c7f03711d (patch)
treec29439d6ff56f3c9729ca884d7dc9ce8e8aaba2d
parent1bd8c15d882fc0420de8956664eefbb2e0d54f42 (diff)
downloadrpm-helper-6076e73d4dd62a7904bb5559de14f77c7f03711d.tar
rpm-helper-6076e73d4dd62a7904bb5559de14f77c7f03711d.tar.gz
rpm-helper-6076e73d4dd62a7904bb5559de14f77c7f03711d.tar.bz2
rpm-helper-6076e73d4dd62a7904bb5559de14f77c7f03711d.tar.xz
rpm-helper-6076e73d4dd62a7904bb5559de14f77c7f03711d.zip
corrected bad grep use
-rwxr-xr-xadd-shell9
1 files changed, 5 insertions, 4 deletions
diff --git a/add-shell b/add-shell
index 099bdaa..e5efbc6 100755
--- a/add-shell
+++ b/add-shell
@@ -26,8 +26,9 @@ if [ ! -f $CFG_FILE ]; then
> $CFG_FILE
fi
-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
+if ! grep -q "^$shl$" $CFG_FILE; then
+ (cat $CFG_FILE; echo "$shl") | sort | uniq > $CFG_FILE.new
+ mv -f $CFG_FILE.new $CFG_FILE
+fi
-exit 0 \ No newline at end of file
+exit 0