Questions tagged [echo]

Simple function outputting text. Exists in script languages.

echo is mainly used in batch (cmd). An example would be:

echo hello world

which prints "hello world" to the terminal.

The output by default prints directly to the command line, however, it may be piped into a following command as an input. This can be very handy and allows for interoperability between different processes/languages.

5742 questions
1
vote
1 answer

Not able to execute echo within legacy in Shell scripting

Below is my code and I am able to get the ssh connection. But after that it is doing nothing. log_time="date +%F\%T" PR_ONE="username@hostname" file="/home/log.txt" to_list="myemail" echo "`$log_time`" >> $file `ssh $PR_ONE "echo df -hP | grep fs1 |…
zeewagon
  • 1,835
  • 4
  • 18
  • 22
1
vote
2 answers

Can an echo program in Clojure be built with lazy infinite sequences?

Take the following program as an example: (defn echo-ints [] (doseq [i (->> (BufferedReader. *in*) (line-seq) (map read-string) (take-while integer?))] (println i))) The idea is to prompt the…
Sebastian Oberhoff
  • 1,271
  • 1
  • 10
  • 16
1
vote
2 answers

What's the difference between two usages of
 tag?

Consider below code : '; a("Peter"); ''; ?> Output : array(2) { [0]=> array(4) { ["file"]=> string(40)…
user9059272
1
vote
1 answer

How can I account for when the user inputs nothing to Alexa after this.emit(":ask", speech)?

I'm writing a game for Alexa but the user input is required. If there is no answer, then the game should end with a unique message of the user's score. Currently, I have the Alexa prompting the user like this. this.emit(":ask", speech); However,…
1
vote
1 answer

Amazon Alexa Music Routine

I just picked up an Amazon Echo Dot for christmas, and I wanted to be able to start a routine on christmas morning, where it would play christmas music and turn on the lights, currently you can only make routines in the app like turn on smart home…
1
vote
1 answer

echo one before the last table row from my database

this is my code that echo last table row . and i wanna echo one before the last table row together with this code . any body can help ? i use this to show table parameters in my application $conn = new mysqli(DB_HOST, DB_USER, DB_PASS,…
user8976812
1
vote
4 answers

NPM command to drop mongo database, using "echo" not working

I'm trying to create an npm command that drops a database from my mongo instance. When I paste this line of code directly into my shell, it works, and gives the output below: > echo 'db.dropDatabase()' | mongo musicappdb MongoDB shell version…
CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
1
vote
3 answers

How to extract and use data values from an open $_SESSION

My page accepts users through invitation codes to take surveys using UCCASS, and inspecting the session data goes as follows: print_r($_SESSION); [invite_code_type] => alphanumeric [invite_code_length] => 10 [priv] => Array ( [37] =>…
1
vote
5 answers

PHP echo $array[$i] not showing anything

I have the following PHP (Version 5.3.0) code: $URL = "http://www.example.com/"; IF ($URL != "") try { $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, $URL); curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $html =…
Timothée HENRY
  • 14,294
  • 21
  • 96
  • 136
1
vote
1 answer

Does Nim have output buffering?

Do I have to flush output when I'm using Nim's echo like I do with Python's print? If yes, how can I do that?
Adrien
  • 469
  • 3
  • 11
1
vote
2 answers

Prevent echo from adding new line

Imagine I have a folder/file structure like the following a/b/c_d.e a/b/d.f I want to mangle the filename so that path separators become _, and between the folder and file is a -, and then that is prepended to the folder…
Red Riding Hood
  • 1,932
  • 1
  • 17
  • 36
1
vote
1 answer

What is the difference between print_r and echo when providing results to an AJAX call?

Although I have found some discussion about the general differences between echo and print_r() in PHP (for example, What's the difference between echo, print, and print_r in PHP?), all the tutorials and answers I've come across for AJAX calls say…
tim.rohrer
  • 246
  • 3
  • 12
1
vote
1 answer

Streaming printing with PHP

I've written a PHP script that makes a request to a search engine, accesses the served results, extracts some details from the results and then prints them in a more useful form. It all works well, but something I've discovered by accident is that…
orlade
  • 2,060
  • 4
  • 24
  • 35
1
vote
4 answers

put a name value inside the div id

here is the BUTTON from the index.php to open the Modal form;
Marvin Acosta
  • 168
  • 10
1
vote
4 answers

Two newlines in one echo command

Simply put, I've set a most basic text progress indicator in a Windows XP/Windows 7 batch file that writes just after a command line tool's output while it works, because it doesn't look like it does anything for a bit. I do so by piping the blurb…
Zandro
  • 13
  • 1
  • 4