Skip to content

Commit

Permalink
printf instead of echo for printing exitcode, because even though the…
Browse files Browse the repository at this point in the history
…re is no functional difference, I think it is good habit to printf, echo was just in there from prototyping.
  • Loading branch information
mentalisttraceur committed May 19, 2015
1 parent 2bc7db0 commit b5f1a88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sshh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# SSH History Logger 1.0.1
# Copyright (C) Alexander Kozhevnikov <[email protected]> 2015-05-09;
# SSH History Logger 1.0.2
# Copyright (C) Alexander Kozhevnikov <[email protected]> 2015-05-10;
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licence as published by
Expand Down Expand Up @@ -36,7 +36,7 @@ timestamp=`date -Is | sed s/://g`
logfile=`mktemp "$logdir"/"$timestamp"_"$*"_XXXXXX` || exit 2

exec 4>&1
exitcode=`((ssh ${1+"$@"}; echo $? 1>&3) | tee -i "$logfile" 1>&4) 3>&1`
exitcode=`((ssh ${1+"$@"}; printf $? 1>&3) | tee -i "$logfile" 1>&4) 3>&1`
exec 4>&-
exit $exitcode

0 comments on commit b5f1a88

Please sign in to comment.