Ori.livneh has submitted this change and it was merged.

Change subject: dotfiles: make `field` read from either stdin or a file
......................................................................


dotfiles: make `field` read from either stdin or a file

Change-Id: Ie1dbbe264cff5f4123134c048564deb3330a0724
---
M modules/admin/files/home/ori/.bash_profile
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/admin/files/home/ori/.bash_profile 
b/modules/admin/files/home/ori/.bash_profile
index 8f5d3c0..f7e2d09 100644
--- a/modules/admin/files/home/ori/.bash_profile
+++ b/modules/admin/files/home/ori/.bash_profile
@@ -69,8 +69,8 @@
 perf()       { sudo perf "$@"; }
 gdbh()       { sudo gdb -p "$(pidof -s hhvm)"; }
 redis-cli()  { command redis-cli -a "$(grep -Po '(?<=masterauth )\S+' 
/etc/redis/redis.conf)" "$@"; }
-fields()     { tail -1 "${@:---}" | awk 'END { for (i = 1; i <= NF; i++) 
printf("%s : %s\n", i, $i) }' ; }
-field()      { awk -v field="$1" '{print $(field)}'; }
+fields()     { tail -1 "${@:---}" | awk 'END { for (i = 1; i <= NF; i++) 
printf("%s : %s\n", i, $i) }'; }
+field()      { local fieldnum="$1"; shift; awk -v field="$fieldnum" '{print 
$(field)}' "${@}"; }
 lat()        { ls -lat *"${@:+.}${@}" | head; }
 sudo()       { command sudo -E "$@"; }
 hbnt()       { /usr/bin/comm -23 "$1" "$2"; } # Here but not there (lines in 
$1 that are not in $2)

-- 
To view, visit https://gerrit.wikimedia.org/r/230174
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1dbbe264cff5f4123134c048564deb3330a0724
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to