Questions tagged [bash]
Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).
3,579 questions
Score of 8
1 answer
479 views
SFTP login hangs in .bash_login on server
I'm managing websites and part of my workflow involves SSH and SFTP logins to the servers. Each server has a "dev" and a "prod" branch on the server.
Upon interactive SSH login to ...
Score of 0
0 answers
83 views
Output of "last" command is corrupted
The output of last appears to be corrupted in Ubuntu server 24.04. Particularly, the first character of every line is truncated. Additionally, I noticed that new logins are not being recorded. Here is ...
Score of 0
2 answers
610 views
How to set environment variable into ssh session without using SendEnv?
We have a shared user account for administrative stuff. I want to use an env var to hold the initiant of the ssh session, so that the .bashrc can do user-dependent execution.
I have tried -o SendEnv. ...
Score of 0
0 answers
25 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/...
Score of 1
1 answer
335 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 ...
Score of 0
1 answer
111 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 ...
Score of 1
5 answers
618 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, ...
Score of 0
1 answer
247 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 ...
Score of 0
0 answers
232 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 ...
Score of 0
0 answers
130 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 ...
Score of 0
1 answer
1052 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 ...
Score of 0
1 answer
155 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 ...
Score of -1
4 answers
957 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:...
Score of 0
1 answer
127 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 ...
Score of 0
2 answers
783 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....