Supply the same filename as argument to two commands

On a git conflict, I can currently do: git diff path/to/some/file.txt … after reviewing the diff, usually I want to do: git checkout –theirs path/to/some/file.txt && git add path/to/some/file.txt It’s painstaking to edit both paths each time, so I’d like to be able to do the following: git checkout –theirs <ref> && git add path/to/some/file.txt … Read more

Terminal vs bash?

I’m on a Mac but I think this is generally Unix-applicable. I’m in the process of learning shell scripting and there’s something I seem to be missing. When I’m in the ordinary terminal, I can use scripting syntax like for loops and such in conjunction with commands to do stuff. But….bash opens an interpreter for … Read more