Redirect to file, including current prompt line
How to include the redirected command itself to the output file redirection? For example
echo "hello!">output.txt
I want the content of output file like this:
echo "hello!">output.txt
hello!
io-redirection
add a comment |
How to include the redirected command itself to the output file redirection? For example
echo "hello!">output.txt
I want the content of output file like this:
echo "hello!">output.txt
hello!
io-redirection
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39
add a comment |
How to include the redirected command itself to the output file redirection? For example
echo "hello!">output.txt
I want the content of output file like this:
echo "hello!">output.txt
hello!
io-redirection
How to include the redirected command itself to the output file redirection? For example
echo "hello!">output.txt
I want the content of output file like this:
echo "hello!">output.txt
hello!
io-redirection
io-redirection
edited Nov 10 at 14:43
ctrl-alt-delor
10.6k41955
10.6k41955
asked Nov 10 at 14:11
mandrake00
294
294
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39
add a comment |
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39
add a comment |
4 Answers
4
active
oldest
votes
You may want one of two things here.
Using
tee
to get the result of theecho
sent to the terminal as well as to the file:
$ echo 'hello!' | tee output
hello!
$ cat output
hello!
Using
script
to capture the whole terminal session:
$ script
Script started, output file is typescript
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done, output file is typescript
$ cat typescript
Script started on Sat Nov 10 15:15:06 2018
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done on Sat Nov 10 15:15:37 2018
If this is not what you are asking for, then please clarify your question.
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?script
should do what you need.
– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
You can suppress the lines about when it was started and stopped by usingscript -q
– Panki
Nov 10 at 14:56
|
show 2 more comments
In the genearality you're asking for, this is not possible.
To achieve this with additional tools (akin to script
(1)), it would be necessary for that program, observing your shell, that in
command >foo
foo
is the name of a file, and create it. Also, the shell would try to create it, so there's conflict already. Also, what if the program would print
command >foo
to the terminal?
From inside the shell, well, the shell's redirection process is extremely primitive from a programming point of view (try to find a C lecture where they build a primitive shell themselves, it is really surprising).
If you really need this, you would have to hack your own shell to intercept redirections and pass the command into the target file. But there are probably a lot of nasty issues in the details...
add a comment |
You can also pipe the whole shell:
$ sh -i |& tee sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
-i
is needed to keep the shell interactive despite stdout not being a terminal. bash and zsh also support that option. |&
pipes stdout and stderr; it works with zsh and bash, but not sh (there, you'd need 2>&1 |
). Of course, you could also use &>
or 2>&1 >
if you just want to redirect to a file and nothing more. Anyways, sh.log
here contains everything.
$ cat sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
add a comment |
If it's acceptable for you to drop the output filename, I think the following is the easiest way:
command='echo "hello!"'
(echo "$command"; eval "$command") >output.txt
But if you need to print the filename then you could use the following:
command='echo "hello!"'
(echo "$command >output.txt"; eval "$command") >output.txt
You can introduce a variable for the filename in order to make sure that it is the same in the two occurrences:
output="output.txt"
command='echo "hello!"'
(echo "$command >$output"; eval "$command") >$output
This way you avoid the risk of having a difference in the printed filename and the actual filename.
1
Generalizing as a function:f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call:f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480956%2fredirect-to-file-including-current-prompt-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You may want one of two things here.
Using
tee
to get the result of theecho
sent to the terminal as well as to the file:
$ echo 'hello!' | tee output
hello!
$ cat output
hello!
Using
script
to capture the whole terminal session:
$ script
Script started, output file is typescript
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done, output file is typescript
$ cat typescript
Script started on Sat Nov 10 15:15:06 2018
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done on Sat Nov 10 15:15:37 2018
If this is not what you are asking for, then please clarify your question.
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?script
should do what you need.
– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
You can suppress the lines about when it was started and stopped by usingscript -q
– Panki
Nov 10 at 14:56
|
show 2 more comments
You may want one of two things here.
Using
tee
to get the result of theecho
sent to the terminal as well as to the file:
$ echo 'hello!' | tee output
hello!
$ cat output
hello!
Using
script
to capture the whole terminal session:
$ script
Script started, output file is typescript
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done, output file is typescript
$ cat typescript
Script started on Sat Nov 10 15:15:06 2018
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done on Sat Nov 10 15:15:37 2018
If this is not what you are asking for, then please clarify your question.
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?script
should do what you need.
– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
You can suppress the lines about when it was started and stopped by usingscript -q
– Panki
Nov 10 at 14:56
|
show 2 more comments
You may want one of two things here.
Using
tee
to get the result of theecho
sent to the terminal as well as to the file:
$ echo 'hello!' | tee output
hello!
$ cat output
hello!
Using
script
to capture the whole terminal session:
$ script
Script started, output file is typescript
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done, output file is typescript
$ cat typescript
Script started on Sat Nov 10 15:15:06 2018
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done on Sat Nov 10 15:15:37 2018
If this is not what you are asking for, then please clarify your question.
You may want one of two things here.
Using
tee
to get the result of theecho
sent to the terminal as well as to the file:
$ echo 'hello!' | tee output
hello!
$ cat output
hello!
Using
script
to capture the whole terminal session:
$ script
Script started, output file is typescript
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done, output file is typescript
$ cat typescript
Script started on Sat Nov 10 15:15:06 2018
$ echo 'hello!' >output
$ cat output
hello!
$ exit
Script done on Sat Nov 10 15:15:37 2018
If this is not what you are asking for, then please clarify your question.
edited Nov 10 at 16:21
Cristian Ciupitu
2,06911621
2,06911621
answered Nov 10 at 14:20
Kusalananda
121k16227372
121k16227372
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?script
should do what you need.
– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
You can suppress the lines about when it was started and stopped by usingscript -q
– Panki
Nov 10 at 14:56
|
show 2 more comments
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?script
should do what you need.
– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
You can suppress the lines about when it was started and stopped by usingscript -q
– Panki
Nov 10 at 14:56
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
Hi! Nanda, Thanks. I know tee. But I want the output file to include the redirect command that we type in, to be in the output file as well. When I do "cat output", I want to see "echo 'helo'>output" before the line "helo". Hope you understood.
– mandrake00
Nov 10 at 14:26
@mandrake00 isn't that exactly what option 2 gives you?
script
should do what you need.– terdon♦
Nov 10 at 14:37
@mandrake00 isn't that exactly what option 2 gives you?
script
should do what you need.– terdon♦
Nov 10 at 14:37
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
Thank you. The typescript output file has many unwanted lines such as "script started at ..." and "<cr><cr> etc. I was looking for a simple method so that when I do { echo 'helo'>out.txt } this would give a file with just 2 lines, i.e. { echo 'helo'>out.txt n helo }
– mandrake00
Nov 10 at 14:45
1
1
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
Do you want this to happen for every single command you ever type in any terminal? Just for specific commands? Please edit your question and give us more specific requirements.
– terdon♦
Nov 10 at 14:46
4
4
You can suppress the lines about when it was started and stopped by using
script -q
– Panki
Nov 10 at 14:56
You can suppress the lines about when it was started and stopped by using
script -q
– Panki
Nov 10 at 14:56
|
show 2 more comments
In the genearality you're asking for, this is not possible.
To achieve this with additional tools (akin to script
(1)), it would be necessary for that program, observing your shell, that in
command >foo
foo
is the name of a file, and create it. Also, the shell would try to create it, so there's conflict already. Also, what if the program would print
command >foo
to the terminal?
From inside the shell, well, the shell's redirection process is extremely primitive from a programming point of view (try to find a C lecture where they build a primitive shell themselves, it is really surprising).
If you really need this, you would have to hack your own shell to intercept redirections and pass the command into the target file. But there are probably a lot of nasty issues in the details...
add a comment |
In the genearality you're asking for, this is not possible.
To achieve this with additional tools (akin to script
(1)), it would be necessary for that program, observing your shell, that in
command >foo
foo
is the name of a file, and create it. Also, the shell would try to create it, so there's conflict already. Also, what if the program would print
command >foo
to the terminal?
From inside the shell, well, the shell's redirection process is extremely primitive from a programming point of view (try to find a C lecture where they build a primitive shell themselves, it is really surprising).
If you really need this, you would have to hack your own shell to intercept redirections and pass the command into the target file. But there are probably a lot of nasty issues in the details...
add a comment |
In the genearality you're asking for, this is not possible.
To achieve this with additional tools (akin to script
(1)), it would be necessary for that program, observing your shell, that in
command >foo
foo
is the name of a file, and create it. Also, the shell would try to create it, so there's conflict already. Also, what if the program would print
command >foo
to the terminal?
From inside the shell, well, the shell's redirection process is extremely primitive from a programming point of view (try to find a C lecture where they build a primitive shell themselves, it is really surprising).
If you really need this, you would have to hack your own shell to intercept redirections and pass the command into the target file. But there are probably a lot of nasty issues in the details...
In the genearality you're asking for, this is not possible.
To achieve this with additional tools (akin to script
(1)), it would be necessary for that program, observing your shell, that in
command >foo
foo
is the name of a file, and create it. Also, the shell would try to create it, so there's conflict already. Also, what if the program would print
command >foo
to the terminal?
From inside the shell, well, the shell's redirection process is extremely primitive from a programming point of view (try to find a C lecture where they build a primitive shell themselves, it is really surprising).
If you really need this, you would have to hack your own shell to intercept redirections and pass the command into the target file. But there are probably a lot of nasty issues in the details...
answered Nov 10 at 16:16
stefan
580312
580312
add a comment |
add a comment |
You can also pipe the whole shell:
$ sh -i |& tee sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
-i
is needed to keep the shell interactive despite stdout not being a terminal. bash and zsh also support that option. |&
pipes stdout and stderr; it works with zsh and bash, but not sh (there, you'd need 2>&1 |
). Of course, you could also use &>
or 2>&1 >
if you just want to redirect to a file and nothing more. Anyways, sh.log
here contains everything.
$ cat sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
add a comment |
You can also pipe the whole shell:
$ sh -i |& tee sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
-i
is needed to keep the shell interactive despite stdout not being a terminal. bash and zsh also support that option. |&
pipes stdout and stderr; it works with zsh and bash, but not sh (there, you'd need 2>&1 |
). Of course, you could also use &>
or 2>&1 >
if you just want to redirect to a file and nothing more. Anyways, sh.log
here contains everything.
$ cat sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
add a comment |
You can also pipe the whole shell:
$ sh -i |& tee sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
-i
is needed to keep the shell interactive despite stdout not being a terminal. bash and zsh also support that option. |&
pipes stdout and stderr; it works with zsh and bash, but not sh (there, you'd need 2>&1 |
). Of course, you could also use &>
or 2>&1 >
if you just want to redirect to a file and nothing more. Anyways, sh.log
here contains everything.
$ cat sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
You can also pipe the whole shell:
$ sh -i |& tee sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
-i
is needed to keep the shell interactive despite stdout not being a terminal. bash and zsh also support that option. |&
pipes stdout and stderr; it works with zsh and bash, but not sh (there, you'd need 2>&1 |
). Of course, you could also use &>
or 2>&1 >
if you just want to redirect to a file and nothing more. Anyways, sh.log
here contains everything.
$ cat sh.log
sh-4.4$ hello
sh: hello: command not found
sh-4.4$ echo hi
hi
sh-4.4$ exit
edited Nov 10 at 21:45
answered Nov 10 at 16:20
JoL
987310
987310
add a comment |
add a comment |
If it's acceptable for you to drop the output filename, I think the following is the easiest way:
command='echo "hello!"'
(echo "$command"; eval "$command") >output.txt
But if you need to print the filename then you could use the following:
command='echo "hello!"'
(echo "$command >output.txt"; eval "$command") >output.txt
You can introduce a variable for the filename in order to make sure that it is the same in the two occurrences:
output="output.txt"
command='echo "hello!"'
(echo "$command >$output"; eval "$command") >$output
This way you avoid the risk of having a difference in the printed filename and the actual filename.
1
Generalizing as a function:f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call:f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
add a comment |
If it's acceptable for you to drop the output filename, I think the following is the easiest way:
command='echo "hello!"'
(echo "$command"; eval "$command") >output.txt
But if you need to print the filename then you could use the following:
command='echo "hello!"'
(echo "$command >output.txt"; eval "$command") >output.txt
You can introduce a variable for the filename in order to make sure that it is the same in the two occurrences:
output="output.txt"
command='echo "hello!"'
(echo "$command >$output"; eval "$command") >$output
This way you avoid the risk of having a difference in the printed filename and the actual filename.
1
Generalizing as a function:f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call:f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
add a comment |
If it's acceptable for you to drop the output filename, I think the following is the easiest way:
command='echo "hello!"'
(echo "$command"; eval "$command") >output.txt
But if you need to print the filename then you could use the following:
command='echo "hello!"'
(echo "$command >output.txt"; eval "$command") >output.txt
You can introduce a variable for the filename in order to make sure that it is the same in the two occurrences:
output="output.txt"
command='echo "hello!"'
(echo "$command >$output"; eval "$command") >$output
This way you avoid the risk of having a difference in the printed filename and the actual filename.
If it's acceptable for you to drop the output filename, I think the following is the easiest way:
command='echo "hello!"'
(echo "$command"; eval "$command") >output.txt
But if you need to print the filename then you could use the following:
command='echo "hello!"'
(echo "$command >output.txt"; eval "$command") >output.txt
You can introduce a variable for the filename in order to make sure that it is the same in the two occurrences:
output="output.txt"
command='echo "hello!"'
(echo "$command >$output"; eval "$command") >$output
This way you avoid the risk of having a difference in the printed filename and the actual filename.
edited Nov 10 at 20:04
wjandrea
466413
466413
answered Nov 10 at 15:25
Erwan
2014
2014
1
Generalizing as a function:f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call:f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
add a comment |
1
Generalizing as a function:f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call:f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
1
1
Generalizing as a function:
f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call: f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
Generalizing as a function:
f(){ command="$1"; file="$2"; (printf '%s >%s' "$command" "$file"; eval "$command") >"$file"; }
Then call: f 'echo "Hello!"' output.txt
– wjandrea
Nov 10 at 19:20
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480956%2fredirect-to-file-including-current-prompt-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have a specific need for this?
– wjandrea
Nov 10 at 19:15
Yes. I have a specific need. I am creating a log file.
– mandrake00
Nov 13 at 11:39