How would I export information produced from script onto a text file [duplicate]
This question already has an answer here:
How do I save terminal output to a file?
7 answers
Scripting novice here.
I have created a script which can show you the ip address of the website which has been entered.
My script:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address"
Script in use:
Enter web address : google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: google.com
Address: 216.58.206.46
How would I then export that information into a text file?
Thanks
bash scripts
marked as duplicate by terdon♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 6 at 23:38
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How do I save terminal output to a file?
7 answers
Scripting novice here.
I have created a script which can show you the ip address of the website which has been entered.
My script:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address"
Script in use:
Enter web address : google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: google.com
Address: 216.58.206.46
How would I then export that information into a text file?
Thanks
bash scripts
marked as duplicate by terdon♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 6 at 23:38
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How do I save terminal output to a file?
7 answers
Scripting novice here.
I have created a script which can show you the ip address of the website which has been entered.
My script:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address"
Script in use:
Enter web address : google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: google.com
Address: 216.58.206.46
How would I then export that information into a text file?
Thanks
bash scripts
This question already has an answer here:
How do I save terminal output to a file?
7 answers
Scripting novice here.
I have created a script which can show you the ip address of the website which has been entered.
My script:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address"
Script in use:
Enter web address : google.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: google.com
Address: 216.58.206.46
How would I then export that information into a text file?
Thanks
This question already has an answer here:
How do I save terminal output to a file?
7 answers
bash scripts
bash scripts
asked Jan 6 at 23:17
JymesJymes
263
263
marked as duplicate by terdon♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 6 at 23:38
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by terdon♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 6 at 23:38
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
./someScript.sh > someFile.txt
Now enter address (e.g. google.com) and hit enter
Or more correct solution - edit script.
For example:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address" > someLogFile.txt
UPD fr you:
The '>' sign here means redirection to file , so if you will type echo 666 > file.txt there will be created file.txt with 666 text inside.
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
./someScript.sh > someFile.txt
Now enter address (e.g. google.com) and hit enter
Or more correct solution - edit script.
For example:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address" > someLogFile.txt
UPD fr you:
The '>' sign here means redirection to file , so if you will type echo 666 > file.txt there will be created file.txt with 666 text inside.
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
add a comment |
./someScript.sh > someFile.txt
Now enter address (e.g. google.com) and hit enter
Or more correct solution - edit script.
For example:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address" > someLogFile.txt
UPD fr you:
The '>' sign here means redirection to file , so if you will type echo 666 > file.txt there will be created file.txt with 666 text inside.
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
add a comment |
./someScript.sh > someFile.txt
Now enter address (e.g. google.com) and hit enter
Or more correct solution - edit script.
For example:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address" > someLogFile.txt
UPD fr you:
The '>' sign here means redirection to file , so if you will type echo 666 > file.txt there will be created file.txt with 666 text inside.
./someScript.sh > someFile.txt
Now enter address (e.g. google.com) and hit enter
Or more correct solution - edit script.
For example:
#! /bin/bash
echo "Enter web address : "
read address
echo "Entered web address : $address"
nslookup "$address" > someLogFile.txt
UPD fr you:
The '>' sign here means redirection to file , so if you will type echo 666 > file.txt there will be created file.txt with 666 text inside.
edited Jan 6 at 23:32
answered Jan 6 at 23:23
Bohdan TkhirBohdan Tkhir
11
11
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
add a comment |
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
Thanks for the help
– Jymes
Jan 6 at 23:32
Thanks for the help
– Jymes
Jan 6 at 23:32
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
@Jymes , you're welcome
– Bohdan Tkhir
Jan 6 at 23:34
add a comment |