Skip to content

Instantly share code, notes, and snippets.

@chrdek
Last active March 7, 2019 21:31
Show Gist options
  • Select an option

  • Save chrdek/fc48ea2ec83bb7bd7e35a77ef0639798 to your computer and use it in GitHub Desktop.

Select an option

Save chrdek/fc48ea2ec83bb7bd7e35a77ef0639798 to your computer and use it in GitHub Desktop.
Print terminal info, previous command runs in terminal cons.
rm "$HOME\Documents\outps.txt"
echo "Home Dir is ---> $HOME" >> "$HOME\Documents\outps.txt"
echo "Default Path is --> $PWD" >> "$HOME\Documents\outps.txt"
echo "Version is --> $BASH_VERSION (not running in ps)" >> "$HOME\Documents\outps.txt"
echo "Term type is --> $TERM (not running in ps)" >> "$HOME\Documents\outps.txt"
cat "$HOME\Documents\outps.txt"
powershell.exe cat "$HOME\Documents\outps.txt"
###########################################################################################
function ret1st() {
return "Last command was: "+$$;
}
ret1st;
function ret2nd() {
return "Latest command was: "+$_;
}
ret2nd;
###########################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment