Questions tagged [bash]
Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).
3,578 questions
0
votes
0
answers
16
views
Bash Script Linux - combines a QUIET function with other functions without hiding some of them
#!/bin/bash
DefaultColor="\033[0m"
GREEN="\033[32m"
RED="\033[31m"
PURPLE="\033[35m"
YELLOW="\033[33m"
CYAN="\033[36m"
CmdOk="\033[...
0
votes
0
answers
22
views
crontab script is not running in other server. In the server we copied, it's running fine [duplicate]
see below details
eccdbpvm02:/mnt/HANA/E1P/backup/data/DB_F1P # crontab -l
05 00 * * * /usr/sys_scripts/clear_log >> /usr/sys_scripts/log.txt 2>&1
eccdbpvm02:/mnt/HANA/E1P/backup/data/...
1
vote
1
answer
251
views
Expect script with telnet - Non ASCII characters on output
I wrote a script to back up some switch configurations with expect.
The script ran like this
/backupSwitches.sh > /outputfile.out
The backupSwitches.sh is
#!/usr/bin/expect
set timeout 5
set host ...
0
votes
1
answer
81
views
How can I connect a remote database server on SlickStack?
By default, SlickStack installs MySQL locally and connects WordPress to a localhost database. I want to skip that, and connect to a remote (managed) database server instead...
What is the proper way ...
1
vote
5
answers
430
views
Remove commas in double quotes from CSV
I have a comma separated line I am using awk to extract fields from.
Server1,poweredOn,10.0.18.70,"Blue, Green",POC,Vsphere
However, when it comes to the text in double quotes ("Blue, ...
0
votes
0
answers
68
views
running screen is slow when running using node's spawn
I'm running this command: screen -S server -X stuff $'\003' when I run it directly in bash it execute immediately. When I'm running it through node's spawn, it takes several seconds for the command to ...
0
votes
1
answer
156
views
How to allow Samba to run root preeexec script with selinux enabled
I am running a SAMBA server on fedora with selinux enabled. I run into problem trying to run a bash script in the smb.conf as root preexec.
The script is executable chmod +x
The script run well if ran ...
0
votes
0
answers
176
views
Common alias for all users
I migrated all my users from Ubuntu 16.04 to Ubuntu 24.04 by adding them to /etc/passwd, /etc/group and /etc/shadow and then executing mkhomedir_helper for each user, see my blog for details.
Today I ...
0
votes
0
answers
96
views
vi's matchit.vim plugin and b:match_words
Some years ago all you had to do was make sure the matchit.vim plugin was installed to be able to match beginning/ending constructs in bash such as if/elif/else/fi but something happened and, although ...
0
votes
1
answer
674
views
Ubuntu 22.04 - Install MySQL 5.7 - Automate Script
I'm working on a legacy platform that we're automating the deploy. It will require multiple iterations until it gets to the point that we use in production. Right now, I'm in the step of setting up ...
0
votes
1
answer
118
views
Bash not using PATH defined in PATH if I use any other number in head -n than 1
This is a little funny one, at least to me. I have a file on which I am running awk and cut command in a loop being fed by head command. The command is:
head -n X all.du.K.txt | while read line ; do ...
-1
votes
4
answers
618
views
How to check if a domain is registered using whois shell command
I have some trouble with some domains.
The command whois from linux shell says No match for domain but I am expecting the domain results to be registered.
$ whois gnso.com
From the shell whois result:...
0
votes
1
answer
83
views
Segmentation fault trying to drop caches
I have been using a script to regularly check for the cached memory and clear it out when there is not enough free memory available. To avoid being too aggressive with clearing the script first does ...
0
votes
2
answers
480
views
systemd fails to run script that otherwise works fine?
I have a golang API that needs to run 24/7 for a nginx proxy backstream.
I have a script..
#!/usr/bin/bash
cd /root/api && go run .
That runs fine manually.
But /etc/systemd/system/api....
0
votes
0
answers
174
views
DOCKER - trying to run mysql and apache both in foreground
FROM ubuntu:latest
Run <<EOF
apt update
apt install -y apache2 mysql-server php libapache2-mod-php php-mysql php-curl php-json php-cgi php-cli php-zip php-xml php-mbstring
apt install wget
EOF
...