Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| function mycd() | |
| { | |
| #if this directory is writable then write to directory-based history file | |
| #otherwise write history in the usual home-based history file | |
| tmpDir=$PWD | |
| echo "#"`date '+%s'` >> $HISTFILE | |
| echo $USER' has exited '$PWD' for '$@ >> $HISTFILE | |
| builtin cd "$@" # do actual cd | |
| if [ -w $PWD ]; then export HISTFILE="$PWD/.dir_bash_history"; touch $HISTFILE; chmod --silent 777 $HISTFILE; | |
| else export HISTFILE="$HOME/.bash_history"; |
| ############################################################################ | |
| # _ | |
| # | |_ _ __ ___ _ ___ __ | |
| # | __| '_ ` _ \| | | \ \/ / | |
| # | |_| | | | | | |_| |> < | |
| # \__|_| |_| |_|\__,_/_/\_\ | |
| # | |
| # Cheatsheets: | |
| # https://devhints.io/tmux | |
| # `property not found` issue: |