Hello,
For the task I'm currently working on, I often find myself typing the following line at the command prompt:
> echo "some_string" >> filename.txt
with the desired result being "some_string" appended to the end of the file. The thing is, I am always appending to the same file, so it would be convenient for me to have a doskey macro to cut down on the typing. Here's what I tried:
> doskey ec=echo $1 >> filename.txt
I would have thought this would allow me to type:
> ec "some_string"
and have the string automagically appended to the file specified in the macro. However, all it does is echo "some_string" to standard output, without appending to the file, like this:
> ec "some_string"
"some_string"
Is there a way to properly construct this macro, or will I have to avoid the problem by writing a script and setting my macro to call that script?
For the task I'm currently working on, I often find myself typing the following line at the command prompt:
> echo "some_string" >> filename.txt
with the desired result being "some_string" appended to the end of the file. The thing is, I am always appending to the same file, so it would be convenient for me to have a doskey macro to cut down on the typing. Here's what I tried:
> doskey ec=echo $1 >> filename.txt
I would have thought this would allow me to type:
> ec "some_string"
and have the string automagically appended to the file specified in the macro. However, all it does is echo "some_string" to standard output, without appending to the file, like this:
> ec "some_string"
"some_string"
Is there a way to properly construct this macro, or will I have to avoid the problem by writing a script and setting my macro to call that script?