echo

`command echo –help` invokes bash internal echo function

`command echo –help` invokes bash internal echo function According to help command, the help of bash, command can be used to trigger the external program x, if x exists as a builtin function too: command: command [-pVv] command [arg …] Execute a simple command or display information about commands. Runs COMMAND with ARGS suppressing shell …

Total answers: 1

Reducing microphone noise using pipewire modules

Reducing microphone noise using pipewire modules With pulseaudio, it was easy to load a module for microphone noise reduction. This link explains it clearly: https://askubuntu.com/questions/18958/realtime-noise-removal-with-pulseaudio I want to add rnnoise as a plugin of pipewire to cancel the noise of the microphone for all users. I’m looking for a minimalist solution and would like to …

Total answers: 2

Print Variable containing backslashes

Print Variable containing backslashes I have something like this: A=$(curl https://mysite.com) and the curl request returns the string "Hello World". When I now want to print A to the console using one of: echo "$A" printf ‘%s’ "$A" the dissappear and it just says "Hello World". What can I do to get "Hello World" on …

Total answers: 1

How to read files of kind "-diary.txt-" using echo?

How to read files of kind "-diary.txt-" using echo? I have a file named "-diary.txt-", I need to get it’s content. When trying to read it using echo < "-diary.txt-", it returns a blank string. I did some research, and came up with this: echo "$(<-diary.txt-)". I tested it out on my computer, and it …

Total answers: 1

extract last part of filename using echo – having assigned variables using wildcards

extract last part of filename using echo – having assigned variables using wildcards I am trying to extract parts of a filename, where I want to extract everything after the first _ and I have found a working solution, see below file=22NGS71294_S191_R1_001.fastq.gz echo $file 22NGS71294_S191_R1_001.fastq.gz echo ${file#*[_ ]} S191_R1_001.fastq.gz but, when I use wildcards, it …

Total answers: 1

watch -n1 $() does not run $() every interval

watch -n1 $() does not run $() every interval watch -n1 $() does not update $(). what is the workaround? here is my example: watch -n1 echo $(( $(date +%s -d "sun") – $( date +%s ) )) this results in Every 1.0s: echo 106602 106602 the expected output should have been: Every 1.0s: echo …

Total answers: 1

Why I can pipe echo into bc, but I can't do the same with printf?

Why I can pipe echo into bc, but I can't do the same with printf? I can pipe echo into bc. But I cannot do the same with "printf": it gives syntax error. ❯ echo "100-5" | bc 95 ❯ printf "%s" "100-5" | bc (standard_in) 1: syntax error Asked By: robertspierre || Source Just …

Total answers: 1

Temporarily unset bash option -x

Temporarily unset bash option -x I like to use set -x in scripts to show what’s going on, especially if the script is going to run in a CI/CD pipeline and I might need to debug some failure post-hoc. One annoyance with doing this is that if I want to echo some text to the …

Total answers: 3

Echo message when flag is detected

Echo message when flag is detected This works well at running Seamonkey only once per 24 hours. I would like to show a message if the flag is detected. I am not sure where to put that echo statement. #!/bin/bash # # Run this script only once a day # Delay is necessary # Creates …

Total answers: 2

Why is it recommended to use "printf — <arguments>" instead of "echo <arguments>?"

Why is it recommended to use "printf — <arguments>" instead of "echo <arguments>?" In the Bash Pitfalls on "Greg’s Wiki" I found the following quote: In fact, the echo command cannot be used with absolute safety here. If the variable contains -n for example, echo will consider that an option, rather than data to be …

Total answers: 1

I am trying to understand what a particular echo statement does

I am trying to understand what a particular echo statement does I am trying to understand what the second echo statement does exactly (it’s an existing script).. echo "Triggering report.. " curl -s -X POST "http://aaa.bbb" echo -e ‘ ‘ I read that -e enables backslash escaping. However, not sure why there is one backslash …

Total answers: 1

How to add echo write commands to sudoers

How to add echo write commands to sudoers I would like to add a command that use echo to write to files into sudoers so that it can be run without a password. Typically the command would go like this: sudo sh -c ‘echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo’ (The sh -c is there because running echo …

Total answers: 3

grep command to get file list with concatenated custom text

grep command to get file list with concatenated custom text I am trying to list of files’ names with custom text(my another command) with it. I am using below command: grep -rl –include=*.php –include=*.html –include=*.js ‘ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js’ httpdocs/test/ | xargs echo "sed -i ‘s~ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js~example.com/js/included/jquery3_6.min.js~g’;" {} ; >> list_js_sed.txt Above command executing fine, without any error and …

Total answers: 1

`echo "${var}"` outputs leading spaces

`echo "${var}"` outputs leading spaces could someone help me? I am trying to create a lot of files, but when I try to write to it with echo it adds a space and single quotes, for example: ‘ (here is the space) file.tmp’ ‘ file1.tmp’ ‘ file3.tmp’ the code is this. cat limpio.tmp | while …

Total answers: 3

Exec format error with "data" file format

Exec format error with "data" file format Does anyone knows why it gives format error when i try to run echo through /bin/echo or /usr/bin/echo but works well if i just type echo in the command line bash: /usr/bin/echo: cannot execute binary file: Exec format error The output file /bin/echo /bin/echo: data What’s that data …

Total answers: 1

Using echo -e with backslash ()

Using echo -e with backslash () I was reading about the echo command in Unix and I got confused in the -e option with the backslash () escaped characters I ran the following two examples : echo "hello\\world" output: hello\world now running the same command with the -e : echo -e "hello\\world" output: helloworld so …

Total answers: 1