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.

May 2025

M T W T F S S
   1234
5678 91011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 7th, 2025 04:00 am
Powered by Dreamwidth Studios