Questions tagged [echo]
32 questions
59
votes
6 answers
How to automatically close netcat connection after data is sent?
I am executing the following command from a script:
echo '{"hostUp": true}' | sudo /usr/local/bin/netcat localhost 8001
However, the netcat client stays open indefinitely. How can I close the connection once this data has been sent?
Justin Meltzer
- 781
25
votes
2 answers
Send echo message to graylog2 via GELF TCP 12201 port
I need to send a message to graylog2 server via echo to test if the %{@type} for facility is corrent, but once I do the echo thats in GELF support does not arrive in to my graylog2 server. If it restart graylog2 then the messages about it starting…
cr0c
- 1,038
10
votes
2 answers
Need a live UDP echo Server IP and port
I require to test my UDP program using echo server. I have tested this application in LAN but now I require it to test it in Internet.
Is there and globally recognize freely available well known ECHO server that I can use directly in my application…
Amit
- 221
5
votes
1 answer
`psql` expanded mode equivalency for `mysql`
Am frustated by things like:
0:33:1407402356:root@ahost:~# echo 'use wordpress_3_6_1; select * from wp_posts;'
| mysql -u mysqluser -pmysqlpasswdord | wc -l -L
42 40585
SQL query results being mangled ugly.
PostgreSQL s psql provides the helper…
178024
- 36
4
votes
2 answers
Getting error "Invalid command 'echo'..." when restarting apache when trying to use SSLPassPhraseDialog
Using a solution to another answer, I added the following to my apache config:
SSLPassPhraseDialog exec:/path/to/passphrase-script
And in that script, I placed this:
#!/bin/sh
echo "put the passphrase here"
Now, when I restart apache, i get the…
David Legatt
- 143
3
votes
3 answers
Can't pipe echo to netcat?
I have the following command:
echo 'HTTP/1.1 200 OK\r\n' | nc -l -p 8000 -c
and when I curl localhost:8000 I am not seeing HTTP/1.1 200 .. being printed.
I am on mac os x with netcat 0.7.1
Any ideas?
#!/bin/bash
trap 'my_exit; exit' SIGINT…
Tinker
- 181
3
votes
2 answers
supress expansion of * in echo
I am working on a script which dynamically executes some queries on daily basis. These queries are coming from a table in the database.
Here is the sample output of the query table:
+---------------+-------------------------------+---------+
|…
divinedragon
- 133
2
votes
1 answer
fdisk with a a single command fail in the second execution
I ran a script to format a disk with fdisk like this:
(echo n; echo p; echo $number_part; echo $firs_sector; echo $second_sector; echo t; echo $format; echo p; echo w) | fdisk /dev/$disk
when i execute for the first time, the format seen like:
…
BrennQuin
- 135
2
votes
3 answers
Bash Script Echo -n
I am writing a bash script, and I want to echo a string, but without a newline automatically added to the end. Reading the man page it says the flag is -n.
The problem is, when I do:
echo -n "My string is here"
The output in the bash script is:
-n…
Justin
- 5,668
1
vote
0 answers
If an echo from tunnel interface IP is successful but an echo from the tunnel interface source fails, is that an outage with ISP?
Trying to track down an outage. Our Cisco ASR has a tunnel configured as
IP: 100.64.#.#
Source: 192.#.#.# (Amazon DX block, this address is also configured as a loopback on another interface)
Destination: 52.#.#.# (tunnel endpoint through…
screampuff
- 111
1
vote
0 answers
xinetd: udp service returning just a string
I'm using xinetd to provide a simple service, that basically only needs to return a string value.
The service is required to support tcp and udp.
The tcp services looks like this, and works as expected:
service simple-tcp
{
disable = no
…
soey
- 111
1
vote
2 answers
Echo Variable - Same way, different output
I wrote a shell script with the following content:
#!/bin/bash
value=`cat test.txt`
echo "Output: $value" >> currentOutput.txt
By executing this script in shell, it writes correctly the value inside the currentOutput.txt. By executing this script…
Tyralcori
- 135
1
vote
1 answer
How to generate a signature with a launchd plist?
Is it possible to implement the following shell script completely as a launchd plist to generate a signature with timestamp in the StandardErrorPath / StandardErrorPath files?
#!/bin/sh
echo "Hi, your FOO.plist was here at $(date)"
This one doesn't…
user3077223
- 13
1
vote
2 answers
Strip out the 'n' \ new line out of the echo to a file
I have a bash script that pulls a bit of text from an external MySQL database. Most of the times it are 4 lines, each one on his own line. This text (in total) has to be placed into a file. The script now pulls the information from the MySQL…
Jona Koudijs
- 85
1
vote
1 answer
echo + append string + linux
please advice how it can be - ( this action was on linux machine )
why the string - "append" that I add with echo is
after the line "spb_IP=172.17.100.122"
and not under the line - "spb_IP=172.17.100.122" ????
more file
spa_IP=172.17.100.121
…
yael
- 2,563