summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhellekin <hellekin@dyne.org>2015-04-14 21:28:23 (GMT)
committer hellekin <hellekin@dyne.org>2015-04-14 21:28:23 (GMT)
commit51ad3cd511b086013b2bbe0a6c912c44db6a9df1 (patch)
tree7634914dec0ad95946cfa14bb3e11e802250a67e
parent19769dea6e086facbc6c521de11a3617bfd5f93f (diff)
Use the pipe, luke (fixes #198)fix-198
-rwxr-xr-xtomb11
1 files changed, 3 insertions, 8 deletions
diff --git a/tomb b/tomb
index 95fb83b..a7476c7 100755
--- a/tomb
+++ b/tomb
@@ -1818,10 +1818,8 @@ mount_tomb() {
tombhost=$(_cat ${tombmount}/.host)
tomblast=$(_cat ${tombmount}/.last)
tombuid=$(_cat ${tombmount}/.uid | tr -d ' ')
- for e in ${(f@)mapfile[/etc/passwd]}; do
- [[ "$e" =~ ":$tombuid:" ]] && {
- tombuser="${e[(ws@:@)1]}" }
- done
+ tombuser=$(getent passwd $tombuid | cut -d: -f1)
+
_message "Last visit by ::1 user::(::2 tomb build::) from ::3 tty:: on ::4 host::" $tombuser $tombuid $tombtty $tombhost
_message "on date ::1 date::" "`date --date=@${tomblast} +%c`"
}
@@ -1983,10 +1981,7 @@ awk "/mapper/"' { print $2 ";" $3 ";" $4 ";" $5 }'`
tombtty=$(_cat ${tombmount}/.tty)
tombhost=$(_cat ${tombmount}/.host)
tombuid=$(_cat ${tombmount}/.uid | tr -d ' ')
- for ee in ${(f@)mapfile[/etc/passwd]}; do
- [[ "$ee" =~ ":${tombuid}:" ]] && {
- tombuser="${ee[(ws@:@)1]}" }
- done
+ tombuser=$(getent passwd $tombuid | cut -d: -f1)
}
{ option_is_set --get-mountpoint } && { print $tombmount; continue }