Sometimes I forget my relative paths and by the time I track down where the file, is I have typed :
Cris-Mac-Book-2:weird cris$ ls ../../../
Icon? Research Support
Cris-Mac-Book-2:weird cris$ ls ../../../Support
Fourganizical PicoCryptical SupportPlan.txt
MoneyProjectical Qwontical Testcomms
OSICAL StanTechStatistical todo
Cris-Mac-Book-2:weird cris$ ls ../../../Support/PicoCryptical
S cs mini php py readme
Cris-Mac-Book-2:weird cris$ ls ../../../Support/PicoCryptical/py/StanTechPico.py
To now run this script, I find myself pressing ← until I get back to the start of the command, then replacing python
with ls
.
When I do this long-hold ← (which seems to be often) I am always thinking, there must be a faster way to edit the command string, or execute the previous command's output.
So, not really qualifying as a bash superuser, I tried to pipe the output of ls to python, which didn't work as intended :
Cris-Mac-Book-2:weird cris$ ls ../../../Support/PicoCryptical/py/StanTechPico.py | python
File "<stdin>", line 1
../../../Support/PicoCryptical/py/StanTechPico.py
^
SyntaxError: invalid syntax
Cris-Mac-Book-2:weird cris$
So my question : how to put the STDOUT
output of a previous command, in the argument position of a new command?
Home
key?Home
key. I apologize.