changeset 268:48b4f41712dc

Suppress warnings in lsof, change filetype bash -> sh
author Steve Huston <huston@princeton.edu>
date Thu, 25 Apr 2024 10:50:06 -0400
parents 857bf32fbaab
children ae940a45bfff
files .bash_aliases .shared/shared_bashrc
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.bash_aliases	Wed Apr 24 19:35:12 2024 -0400
+++ b/.bash_aliases	Thu Apr 25 10:50:06 2024 -0400
@@ -68,7 +68,7 @@
   # Let's check if things exist and we can just use them as-is
   if [ -e $PIDFILE ]; then
     DOTSHARE_PID=`cat $PIDFILE`
-    DOTSHARE_PORT=`lsof -n -p $DOTSHARE_PID | grep LISTEN | awk '{print $9}' | sed 's/.*://'`
+    DOTSHARE_PORT=`lsof -w -n -p $DOTSHARE_PID | grep LISTEN | awk '{print $9}' | sed 's/.*://'`
     if [ -z $DOTSHARE_PORT ]; then
       echo "Server PIDfile found but couldn't get a port, aborting"
       return 255
@@ -109,7 +109,7 @@
   # Give it a moment to collect its thoughts...
   sleep 1
   DOTSHARE_PID=`cat $PIDFILE`
-  DOTSHARE_PORT=`lsof -n -p $DOTSHARE_PID | grep LISTEN | awk '{print $9}' | sed 's/.*://'`
+  DOTSHARE_PORT=`lsof -w -n -p $DOTSHARE_PID | grep LISTEN | awk '{print $9}' | sed 's/.*://'`
   echo "Server PID $DOTSHARE_PID ready on port $DOTSHARE_PORT"
   export DOTSHARE_PID DOTSHARE_PORT
 }
@@ -286,7 +286,7 @@
   else
     if [ -e $ROOT/.hg/hgserve-PID ] ; then
       P=`cat $ROOT/.hg/hgserve-PID`
-      URL=`lsof -n -p $P | grep LISTEN | awk '{print $9}'`
+      URL=`lsof -w -n -p $P | grep LISTEN | awk '{print $9}'`
     else
       URL=`hg serve -d -p 0 --pid-file $ROOT/.hg/hgserve-PID | sed 's#.*at http://\(.*\)/ (bound.*#\1#'`
     fi
@@ -342,4 +342,4 @@
   echo Files stored in $OUTDIR
 }
 
-# vim: set filetype=bash :
+# vim: set filetype=sh :
--- a/.shared/shared_bashrc	Wed Apr 24 19:35:12 2024 -0400
+++ b/.shared/shared_bashrc	Thu Apr 25 10:50:06 2024 -0400
@@ -123,4 +123,4 @@
 alias vi='vim'
 
 
-# vim: set filetype=bash :
+# vim: set filetype=sh :