All Questions
Tagged with ubuntu-22.04 bash
16
questions
0
votes
0
answers
29
views
How can I set a path to a variable in the bash shell? [duplicate]
I'm following the documentation for Seismic Unix software to install it on Ubuntu 22.04. However, I'm having trouble properly setting the path to a specific variable in the bash shell.
According to ...
-1
votes
1
answer
127
views
Silent read illegal [duplicate]
I'm trying to use silent reading in a Bash script in Ubuntu 22.04:
#!/bin/bash
sensitive_input() {
read -rsp "${1}: " value
echo "$value"
}
x=$(sensitive_input "...
0
votes
0
answers
105
views
Send a mail using cronjob from a Linux system
I have a school project which requires that I send a mail using cronjobs, it was intentional for learning purposes, after several research online, I got to know that I have to install an MTA on my ...
0
votes
0
answers
23
views
Backing up file with cp fails when using variable [duplicate]
Little bit stumped here. I'm trying to write a simple bash function I can call to make a backup of my current ~/.bashrc file. The function basically does this:
backup_filename="~/.bashrc_`date +%...
0
votes
0
answers
110
views
git diff folder_orig folder_dest exclude .git folder recursively
From these two folders and their subfolders, I want to exclude all folders named .git from the comparison made by git diff.
On other similar topics there are solutions in which there is only the ...
1
vote
2
answers
146
views
usercustomize.py runs automatically but does not store variables and functions
I have followed the instructions in this topic:
Is there a way to always execute a script when python starts? (similar site.profile in R)
Part of the output of python3 -m site:
USER_SITE: '/home/<...
1
vote
1
answer
313
views
navigator.userAgent no longer works on /opt/google/chrome/chrome since version 113
This is the site where I learned the procedure to output the userAgent using bash on Ubuntu 22.04:
Get the "user agent" string from a new Google Chrome browser session from bash
and I had ...
0
votes
1
answer
499
views
how do i run a bash script by only typing name rather than path/name.sh?
I want to run a bash script named hello (just as an example) and want to run it by just typing hello rather than path/hello.sh. The purpose is to run scripts like how we run docker, mysql, git etc ...
-1
votes
2
answers
142
views
How to use bash to get the dhcp server ip from linux / ubuntu specifically?
Would like to return just "123.235.44.1" value from below. how do i do this?
# dhclient -v
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All ...
0
votes
3
answers
69
views
bash - here-document - problems with special characters together with double quotes despite the "repr"
Positive case:
set -- 'no " tabs' 'tab and double quotes "'
repr="$(printf -- '%q ' "$@")"
echo "$repr"
Output:
no\ \"\ tabs $'tab and double quotes\t&...
1
vote
1
answer
1k
views
I am getting a strange error when running MPICH 4.0.3
I am getting an error when running mpirun:
will@will-MS-7D91:~/WRFHYDRO/Tests/Compatibility$ mpirun ./a.out |& tee comp_test2.txt
C function called by Fortran
Values are xx = 2.00 and ii = ...
0
votes
1
answer
82
views
here-document with bash -c
This example script:
cat <<- EOF | bash -c
command1 args
command2 args
command3 args
command4 args
command5 args
EOF
Returns: bash: -c: option requires an argument
How do I ...
0
votes
1
answer
176
views
I want to prefer /usr/bin/echo versus built-in echo in Ubuntu within Webmin - I've asked in that specific forum too [duplicate]
RE: Webmin Question
SYSTEM INFORMATION
Ubuntu 22.04.1 LTS (AWS Instance) Codename: jammy
Webmin version 2.010
I’ve got tons of custom commands in Webmin. In RHEL they used to work fine but some of ...
3
votes
4
answers
4k
views
Get the "user agent" string from a new Google Chrome browser session from bash
I want to get the User Agent HTTP request header string from a new Google Chrome browser session (just opened) from bash and put it in a variable.
Here is the pseudo-code:
USER_AGENT="$(google-...
-1
votes
1
answer
604
views
How to include regular expression on a file for 'tar' command option '-T'
I'm trying to archive my project directories and files using -T, --files-from option.
Here's a sample that similar to my project setup
testproj
|
|__testapp
| |
| |__src
| | |
| | |__test1.js
| ...