Code:
pwd > cat > /tmp/tc.txt
will work, although it relies on the external pwd command (which should always be present in theory). The > cat is irrelevant; cat just takes its input(s) and outputs them, so this command is the same as
Note that /tmp is the tmp subdirectory of the / top-level directory. It's better to use $TMP to refer to this location, because it may concevably differ across platforms.
You need to make a rule to perform the command:
Code:
gettmp : prerequisites
mkdir tmp && echo $CWD > tmp/cwd.txt
This will run the commands without the need for an external script; the && means to run the echo command only if the mkdir command succeeds.
At least, that's how you'd do it in a Makefile. You'll need to look at the autoconf documentation for more details.