156,592 questions
0
votes
0
answers
28
views
Is there a way to tell my bash script to ignore a specific set of backticks rather than interpolating?
I have a bash script that is taking some input and sanitizing it for use in another command. In my script, I'm running the material through a filter like so:
#!/usr/bin/env bash
...
echo "$...
-1
votes
0
answers
28
views
Why doesn't "set -e -E" affect subshells in if conditions?
I have a multi-step check before deciding whether to execute some code. In words: "The code should be executed, if a guard file does not exist, and there are no files newer than a guard file.&...
-1
votes
1
answer
98
views
Using awk in ksh script
I have a requirement to split a large CSV file using KSH script. I came across below link which is using AWK utility
Split CSV files into smaller files but keeping the headers?
I tried the same as ...
-4
votes
0
answers
36
views
Screenshot-to-code Instrument doesn't work from Russia with VPN [closed]
link to instrument
I've made backend and frontend work, I have API key, but when I download screenshot there is an error:
Error code: 404 - {'error': {'message': 'The model gpt-4o-2024-05-13 does not ...
0
votes
3
answers
79
views
Filtering regex from bash variable containing text
I have variable in bash:
$ users_="a1 .localhost a2 a3 .localhost a4"
I'd like to read into bash array all phrases startking with 'a' and ending with '.localhost', which in this case will ...
1
vote
1
answer
65
views
join with |, sort on three files
I've tried to understood CLI's 'join' and came to this:
file 1 (nobel_laureates.txt):
1901,Jean Henri Dunant,M
1901,Frederic Passy,M
1902,Elie Ducommun,M
1905,Baroness Bertha Sophie Felicita Von ...
-1
votes
0
answers
28
views
Shell Script inconsistency; please explain [closed]
Here are two identical files, script files to open/close a CD/DVD.
eject works as is, load has to be typed ./load to work. They are identical.
Please explain, if you can.
Also, a fix would be nice.
...
0
votes
2
answers
54
views
How To Fix Unbound Variable?
I was running a script and got the error: ./run.sh: line 21: $1: unbound variable
Here it is
# Make sure we have something to run
**if [ "$1" = "" ]; then
** log "Usage: $0 ...
0
votes
1
answer
27
views
Cron job providing a specific line in my error log file
I have a bash script that uses ping testing for internet access, that has a cron job initiating the script with a 2>&1 output of any issues.
However, I need those issues, to write a specific ...
0
votes
1
answer
29
views
use return code function if statement from another shell script
I have shell script called script_1.sh like below
# query
batch_count_query="SELECT COUNT(*) AS COUNT FROM ${db_name}.${table_name} WHERE BATCH_STATUS = "RUNNING";"
echo "****...
-3
votes
0
answers
38
views
Linux command to replace placeholder in one file using value from another file using awk [closed]
I want to replace placeholder in one file using value from another file using sed/awk commands. Following conditions need to follow during field substitution.
Condition:
1. Use sed/awk/bash to handle ...
-2
votes
0
answers
26
views
sed to replace a value in xml [duplicate]
Below is an excerpt of an xml file I need to modify:
<config>
<panel>
<name>AppsPanel</name>
<visible>false</visible
</panel>
<...
0
votes
1
answer
38
views
Delayed execution when using bash's trap command?
I use the following .bashrc code to display execution times per command:
ps1_starttime() { PS1_STARTTIME=$EPOCHREALTIME ; }
ps1_duration() { printf "%0.3f" $(bc <<< "$...
-1
votes
0
answers
15
views
Install packages through command in ubuntu vm
In my Vm's agent i have already configured openssl, libsoup2.4, glibc etc i want to update to new or some particular version how to upgrade or update the version in ubuntu vm.
i tried below approaches ...
0
votes
1
answer
35
views
Less verbose execution of a backup file with psql (only show actual errors and warnings)
How to make psql less verbose when I restore an SQL backup file? I want Postgres to only show me errors and maybe notices, nothing else.
So I want to see errors like this:
ERROR: relation "...