print to stderr (debug) except public key
authorAJ ONeal <coolaj86@gmail.com>
Wed, 11 Nov 2020 20:37:26 +0000 (13:37 -0700)
committerAJ ONeal <coolaj86@gmail.com>
Wed, 11 Nov 2020 23:28:03 +0000 (16:28 -0700)
ssh-utils/ssh-pubkey.sh

index 588dcca307f8e859683e1e5f45d6fd8748078ef3..ed5c345aaa91b472414338ea12ecd1d482b15308 100644 (file)
 
     if [ ! -f "$HOME/.ssh/id_rsa" ]; then
         ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
-        echo ""
+        >&2 echo ""
     fi
 
     if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
         ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
-        echo ""
+        >&2 echo ""
     fi
 
     # TODO use the comment (if any) for the name of the file
-    echo ""
-    echo "~/Downloads/id_rsa.$(whoami).pub":
-    echo ""
-    rm -f "$HOME/Downloads/id_rsa.$(whoami).pub":
+    >&2 echo ""
+    >&2 echo "~/Downloads/id_rsa.$(whoami).pub":
+    >&2 echo ""
+    rm -f "$HOME/Downloads/id_rsa.$(whoami).pub"
     cp -r "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
     cat "$HOME/Downloads/id_rsa.$(whoami).pub"
-    echo ""
+    >&2 echo ""
 }