Feb. 8th, 2018

jbanana: Badly drawn banana (Default)
Suppose you want do a thing which needs a directory, and you want to pass it the current directory.

In Bash and other similar shells, you can say something like:
doThing $(pwd)
The dollar-bracket bit is replaced with the output of the command in the brackets.

At the Windows command pompt, you can kind-of do that.
for /f "tokens=*" %G in ('cd') do \@doThing %G
It's not exactly the same. If the command in brackets produces multiple lines, the Windows version will do the thing once per line. The Bash version will do the thing once with lots of params.

August 2025

M T W T F S S
    123
45678910
11121314151617
1819202122 2324
25262728293031

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 2nd, 2025 03:12 pm
Powered by Dreamwidth Studios