Nieuws:

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: Gebruik van History. Kan de pwd van de historylijst erbij worden weergeven?  (gelezen 569 keer)

Offline bart85

  • Lid
Bij het gebruik van history wil ik ook in beeld krijgen vanuit welke directory een commando is uitgevoerd. Het gaat vooral om het commando make. Van belang is: "Vanuit welke directory is het uitgevoerd?"
Kan bij ieder commando deze directory worden weergeven?
Je leert maar mooi over weg gaan met de commandline.
Linus: "I'm happy with the people who are wandering around looking at the stars but I am looking at the ground and I want to fix the pothole before I fall in."
I look to the clouds behind me and see the thunder coming.

Offline aartje

  • Lid
Je zou in je homedirectory een bestand kunnen maken genaamd  .bashrc (let op de punt!)
met als inhoud:
export PROMPT_COMMAND='hpwd=$(history 1); hpwd="${hpwd# *[0-9]*  }"; if [[ ${hpwd%% *} == "cd" ]]; then cwd=$OLDPWD; else cwd=$PWD; fi; hpwd="${hpwd% ### *} ### $cwd"; history -s "$hpwd"'

Zie:  http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history