Questions tagged [echo]
Simple function outputting text. Exists in script languages.
5,742
questions
-2
votes
0
answers
35
views
How can I call a Javascript function in a Javascript file from a php file [duplicate]
php file
I have been attempting to build a website from scratch to learn about the process, but I am currently roadblocked. I cannot call my JavaScript function from my php file. Any suggestions ...
1
vote
1
answer
37
views
Product details are not available on WooCommerce product page
I have the following code that I'm using to display a modal containing some of the information from the current product page:
function visualizer_modal() {
if(!is_product()) {
return;
}...
-2
votes
3
answers
104
views
how to print a string with a variable by using echo command in the shell script
I defined a shell variable in the terminal and then used the echo command to output a string with that variable and it worked fine in the terminal.
But when I use the same command in a shell script, ...
0
votes
0
answers
21
views
How do I include an ID number into a URL in a dynamic way and display the content on the page?
I have a WordPress site that is allowed to display data from another site and I've created the PHP echo statement correctly to display the content.
But the Read More URL scheme is thus: ?...
-1
votes
0
answers
32
views
CMD Batch Variable Blank when Echo [closed]
I have a command batch file where I am using SET for a variable and trying to use that variable but it is blank. I have simplified my batch file for this forum.
Here is the script:
:submenu_check
ECHO ...
0
votes
2
answers
61
views
Why does this work in this bash script's function?
I saw a function in a tutorial and I think it's pretty cool. It's for coloring text.
Function is defined like so:
function print_color(){
case $1 in
"green") COLOR='\033[0;32m' ;;
...
-2
votes
1
answer
26
views
how to make PHP echo data as it in table
Current Code:
// Display flight details
echo "<h2>Flight Details</h2>";
echo "Aircraft Name: $aircraft_name<br>";
echo "...
0
votes
1
answer
33
views
what does echo modifiers "f|" do in bat file [duplicate]
What does "f|" do in this bat command
echo f|xcopy /Y /v "foo.exe" "%TargetFile1%"
0
votes
1
answer
14
views
Discord bot python echo command image
I have a command that bot echo my messages, but if I paste the image, bot has an error and I dont know how to fix it. I want my bot will be able to use the echo command and insert the photo I pasted.
...
0
votes
0
answers
13
views
Assigning a function to a variable immediately prints echo? PHP
I'm fairly new to PHP, so bear with me, this made me curious. I suppose my question is why does assigning the function to the variable print the echo of the function, and why doesn't it print the echo ...
0
votes
1
answer
18
views
Confusion about Newline Interpretation in Command Line Echo with Double Quotes
I've been learning about command line expansions and substitution, including path name expansion and command substitution. In my studies, I came across the concept of controlling these expansions ...
0
votes
1
answer
61
views
Bash Script: Adding newline after `read` command with -s flag
I am working on a BASH script that will install & configure git on a (new) linux machine and also clone the user's chosen repository. The script takes a couple of arguments and I'm trying to use ...
0
votes
0
answers
78
views
code 1284 Class "Sample" is reserved for use by Microsoft; code 1293 Service "ECHO" is reserved
I am trying to run the echo demo from this repository, but got some errors as the image shows below, anyone knows how to solve this problem?
enter image description here
I had tried from this page:
...
-1
votes
1
answer
52
views
Linux command shell script
I am searching in linux logs file which have some error code I wants to calculate these code on hourly basis but my requirement is that response code should be show in below form . In attach file data ...
0
votes
1
answer
63
views
echo output of logical expression in bash script ubuntu [duplicate]
var1 = 'abc'
var2 = 'bc'
echo "Print result: $[[$var1 =~ $var2]]"
This echo command is not working. How would I print the output of the logical expression $var1 =~ $var2 correctly?
I want ...
0
votes
0
answers
27
views
bash While script not echo correctly [duplicate]
I have a text file /tmp/tmpGetFilefile-only.
In the Text File it has the following (there is no blank line between the values)
goce
gocetengoce
When I run the below script
#!/bin/bash
while read -r ...
0
votes
0
answers
61
views
Same echo command which has control characters showing different output
If I run echo -en "aap\0icon\x1f${icon}\n" like:
#!/usr/bin/env bash
array="Alacritty vscodium firefox-esr io.github.cboxdoerfer.FSearch folder"
for icon in ${array}; do
echo ...
0
votes
2
answers
88
views
Why does Bash have both a built-in echo command and standalone echo programs?
I am using a Bash shell on Ubuntu 22.04.
When I run type -a echo, I get the following output:
What I understand is that when I run a command, let's say echo "Hello Wolrd!", Bash will run ...
0
votes
1
answer
40
views
printing variables with echo in a makefile
For airflow I wanted to run this:
echo -e "AIRFLOW_UID=$(id -u)" > .env but this outputs in the env file: -e AIRFLOW_UID=
I was expecting something like:
AIRFLOW_UID=1001
I've read that ...
0
votes
1
answer
65
views
echo response PHP vs println Scala [closed]
I have below PHP function code which echoes the server's response.
PHP Code
function printMessage($errMsg){
$color='#ffffff';
echo "<table style=>";
echo "<tr ...
-1
votes
1
answer
45
views
No output from echo [closed]
The below script has passed verification @ ShellCheck
#!/bin/bash
SRCDIR='/home/vinod/src'
ALLSRCFILES=${SRCDIR}/.
PODMANCMD='podman ps'
GITWORKSPACE='/workspace/vinod'
CONTAINER=$(eval "${...
0
votes
1
answer
28
views
Why does an additional `*` gets appended to the output in the following bash command?
When I run the command $ echo "Hello, World!" | tr -c 'aeiou' '*', the terminal returns *e**o***o*****. There are only 4 characters after the last vowel o, so tr should replace each of them ...
0
votes
0
answers
50
views
nano and echo behave different at inotify
I did a small test sw in go and inotify.
It detects file modifications.
If I do the textfile modification with nano, I get two modification detections,
If I do it wit echo I get only one modification ...
0
votes
0
answers
5
views
Command echo on file returns no space error
script have a query and if returns around 1200 records it is ok, but when it returns more than 1200 records echo fails with no space, space in the server is available.
(1454 rows affected)
if [ echo &...
0
votes
0
answers
33
views
Using output of shred for zenity progress bar
Hello I am new to Linux and wanted to creat a progress bar with zenity using the output of shred.
I tried to pipe the output into an echo. But echo doesnt use the input.
I also tried piping it into a ...
1
vote
2
answers
51
views
How to unambiguously quote when printing all args passed to a bash function? But taking care to quote special characters, avoid using the backslash?
Basically I need a shell function called echo_Q (or an echo -Q option), than will echo a quoted argument list, while "[nicely]" strictly avoiding any backslash-quoting on any of the ...
1
vote
3
answers
58
views
Bash output text formatting from loop
I'm just trying to clean up some output from a one-liner script I run to check for file existence. To test I'm using 2 different terminals open on the same directory and running a continous "...
0
votes
0
answers
14
views
Is there a way to control keyboard HID devices via COM port commands?
Does anyone know if keyboard HID devices accept COM commands (via echo or other methods) to trigger keys?
Otherwise, does anyone know how to simulate key presses from a HID device itself?
I need to ...
1
vote
2
answers
69
views
What parameters can we specify along with it's acceptable options in CORSWithConfig using middleware in Echo Framework Golang custom configuration
What are the parameters and their acceptable values, and how to use CORSWithConfig custom configuration in middleware while using echo framework, in golang, to handle CORS.
0
votes
0
answers
24
views
Why is my bash while loop changing the order of the output text from what is inputted? [duplicate]
I am new to bash scripting, but I am trying to make a small portion of a larger bash script work and I am running into a strange problem.
I want to read input data from a .csv file (test_events.csv in ...
0
votes
1
answer
83
views
How to inject a timestamp when recording a ssh session?
I have been utilizing this command line to secure shell into a host computer and record the session terminal and direct it to an associated .txt file.
ssh -t dobby1997@${IP} "script -t 2> ...
-1
votes
1
answer
20
views
Show an icon for a get_user_meta
On my website I have a list of members and for each of them I display some info. One is the website URL. I would like to show the URL as an icon rather than the actual URL. The website address is ...
0
votes
1
answer
21
views
Hot to paste a text copied from a file using cmd " Get-Content -Raw file_name | clip " to a new file in another directory
I copy a text from .cpp file using the command-line using this command Get-Content -Raw file_name | clip in Windows 10
and I'm trying to paste that text into another file in another directory
I've ...
-1
votes
1
answer
30
views
Show an icon for a echo esc_html value
On my website I have a list of members and for each of them I display some info. One is the email address.
I would like to show the email address as an icon rather than the actual email address.
The ...
0
votes
0
answers
34
views
Difference when ending a process with CTRL+C vs. kill
Environment:
LINUX-Controller <---> Electricity meter1 & Electricity meter2
communication via RS485 MODBUS-RTU (without terminating resistor)
baud rate: 9600
both meters communicate via the ...
0
votes
0
answers
31
views
redirecting the output of a echo based redirect command to a log_file [duplicate]
I want to redirect the output of a linux command to a log_file. I am first echoing a command to trigger some logs, I want those logs to be stored in a file?
#echo "m" > /proc/sysrq-...
0
votes
1
answer
64
views
Logrus library go didn't formatted as well
I use the logrus library for my logging purposes and my expectations are like the logs in the documentation, which are like this:
And this is my log while using logrus :
I've read through the ...
0
votes
1
answer
51
views
Running batch file as admin does not echo variable to .txt file nor set the variable to the .txt file's content anymore
I want to run a batch file as admin and echo a variable to a .txt file or if the .txt file exists set a variable to the .txt file's content.
Running the batch file as without admin privileges my code ...
1
vote
1
answer
46
views
Run and Execute a Program Using A Batch File
I have this batch script that helps me download and run my programme automatically. But here is the issue I am having: This makes its own directory, but the downloaded programme does not store ...
0
votes
0
answers
104
views
How to make PHPUnit output errors?
I'm running PHPUnit from the command line in windows as follows:
php phpunit.phar --bootstrap .\commonTests\bootstrap_local.php .\commonTests\DIContainerTest.php --testdox --stderr -v
and I'm ...
0
votes
1
answer
36
views
how to insert this background image url in printf php?
i want to add this background image :
style="background-image: url( '<?php echo $this->video->category->image; ?>' );"
inside /a href=""/ under this printf :
printf( ...
1
vote
2
answers
273
views
Serving static files for golang in docker-container using echo middleware
So. I have a stucture like this:
app
-api
-templates
-examples
-html
using echo like this
e.Use(middleware.StaticWithConfig(middleware.StaticConfig{
Root: "examples/html",
...
-2
votes
3
answers
58
views
Database connection refused error when connecting to Apache Age database using Echo framework in Go
I'm working on a Go application using the Echo framework, and I'm encountering a 'database connection refused' error when trying to connect to my Apache Age database.
I have the necessary database ...
0
votes
0
answers
238
views
Laravel 10 Echo listing event for pusher for real time change?
Here is My web route
Route::post('/create/store', [TaskController::class, 'store'])->name('task.store')->middleware('auth');
store method in the controller for inserting data
public function ...
1
vote
1
answer
71
views
bash: single quotes disappear while appending text to a file
I am trying to append a multiline text containing some single quotes(') to a file which is present on a different machine and can be only accessed through a different user.
Here is my code snippet:
...
0
votes
1
answer
69
views
Batch script to output git sha1id to a #define in header file
I would like to create a batch script that can insert the current git sha1-id as a "#define" in a header file. I want the batch script to basically create (and overwrite) this new header ...
0
votes
1
answer
278
views
jenkins pipeline echo multi line or hide the echo command
I'm working on a jenkins pipeline, having to execute an URL, which returns log information in JSON.
We can get the correct info from this JSON, but on echo the output, it will all be on one line, ...
3
votes
2
answers
114
views
Why does "echo" operate like "echo -e" in my bash?
I stumbled upon a weird problem with echo on GNU bash, version 5.1.12(1)-release (x86_64-pc-solaris2.11):
bash-5.1$ builtin echo -e 'a\tb'
a b
bash-5.1$ builtin echo 'a\tb'
a b
bash-5.1$ ...
0
votes
1
answer
46
views
How can I view the Squid access log file in PHP?
I'm trying to access the content of the Squid access log file to show it on a simple webpage with PHP, but whatever I do, the page turns out white. Please note, this is a test environment, so every ...
0
votes
1
answer
75
views
Using a `redirect` with `setpriv` to a file with restrictions
I want to write a file my_file.txt using echo within my bash script. The file has the permissions:
drwxr-xr-x 2 snap_daemon root 4096 Apr 11 15:56 my_file.txt
How can I use setpriv in conjunction ...