Questions tagged [bash]

Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

bash is the Bourne Again SHell, the successor to the classic Unix Bourne shell (sh). It's the default shell on many Linux distributions, including RedHat, CentOS, Debian, and Ubuntu.

The premier online guide is the BashGuide.

3527 questions
1
vote
1 answer

How to hide a password from ps, if it's given to a process via script or command line

So I have a certain program, which is running almost 24/7. I have a start script I've written in bash which simply does: ./app --user XXX --pass YYY There are a few more options, but they are irrelevant to this question. Once run, the pass will…
Sam
  • 11
  • 2
1
vote
5 answers

bash script - print from line N to EOF

I want to be able to print the number of lines from bash as such: Line number (as counted from the top) -> end of the file It seems tail will only count lines from the bottom. Does anyone know how to do this? Thanks. I've tried the following # Where…
bobinabottle
  • 579
  • 2
  • 7
  • 19
1
vote
2 answers

Bash script to convert archive to .zip format

I'm looking for a flexible bash script to do the following: Convert .rar, .tar, .tar.gz, .bz2, .7z archives to .zip format Keep all folder structures and filenames as source archive. Convert it quietly, outputs "error" on failure and outputs…
jack
  • 1,725
  • 5
  • 21
  • 25
1
vote
1 answer

Bandwidth limiting for import of a large SQL file

I am trying to import a large MariaDB dump file in a running MariaDB instance (production) without any performance issues. In order to do so i am trying to use cpipe, for a throughput speed limit as below: /usr/bin/mysql -uuser -ppass -h host DBname…
Alex
  • 340
  • 3
  • 8
1
vote
2 answers

How to unset environment variables from script

if I need to unset an environment variable from script it used to be "sourced" like . ./myscript.sh or source ./myscript.sh But how do i make this work, if i launch this script from supervisord? [program:myapp] command=source…
David
  • 29
  • 1
  • 4
1
vote
1 answer

Debugging rsync over SSH in verbose mode using tee to redirect stdout to log file

I have been having issues with various rsync operations over SSH, on a particular machine on our network, failing and giving errors like: rsync: connection unexpectedly closed (45482 bytes received so far) [generator] I found a similar post (rsync…
PicoutputCls
  • 253
  • 4
  • 15
1
vote
1 answer

Schedule a Script Job to run automatically but requires user interaction/input

I initially started this script for something else, thinking it would be nice for the script to handle the full process automatically, reboot, and start more script stuff. Then I realized I had a problem, as another process I need to run does…
Wade S
  • 11
  • 3
1
vote
1 answer

adquery command returns empty results but sometime later it gives the expected result. Unusual behaviour

We have a server infrastructure which has hundreds of servers. All those servers are accessed through a key server. We have centralize to mange authentications. So what I tried is I used this bash command in our key server to list all users in the…
Laksith
  • 93
  • 9
1
vote
0 answers

How to auto accept new ssh fingerprints but decline changed?

I have a script that deals with some servers in an environment where new hosts are added once in a while. I'd like to avoid being asked whether new fingerprint should be accepted but be warned if any previously known fingerprint have been changed.…
1
vote
1 answer

What's the most resource efficient way to count how many messages sendmail has queued?

sendmail 8.14.4 I want to setup monitoring to track how many queued messages I have on my sendmail server. As per a somewhat related linux question I understand that the most efficient way to count raw files in a directory is \ls -afq | wc -l but…
Mike B
  • 11,871
  • 42
  • 107
  • 168
1
vote
1 answer

rm no longer asking for confirmation when deleting files?

On my CentOS 6.9 box I've just spotted that rm myfile no longer asks me if I really want to delete it, it just deletes it. I've run alias and there's nothing to do with rm there. What else could be making it act as if I'd supplied -f when I haven't?
Codemonkey
  • 1,086
  • 4
  • 19
  • 41
1
vote
1 answer

simple bash script to check if tunnel exists [catching stdout and stderr]

i'm trying to write a simple bash script for a cronjob to check if some interfaces (tunnels) exsisting. if not i'd like to start another script that (re)starts them. my problem is: i don't get the "IF" working: #!bin/bash for i in tun1 tun2 tun3…
Kjellson
  • 85
  • 6
1
vote
2 answers

Execute command then parallelize other commands after completion

I'm looking for a single inline command to execute /bin/first and then when it completes execute the following /bin/p1, /bin/p2, /bin/p3 in parallel after.
Justin
  • 5,328
  • 19
  • 64
  • 84
1
vote
1 answer

How to do an automated Restore of Cassandra Backup(Snapshot)?

I do have a single node Cassandra EC2 instance (apache-cassandra-3.10), in which I take snapshots (backup) on daily basis and upload it on AWS S3. I also take the backup of complete "schema" and "initial tokens" and keep it over S3.I have managed to…
1
vote
0 answers

ssh-keygen -s outputs half of a created key and fails

So I'm running ssh-keygen to sign a user certificate. The command I'm using looks like this: ssh-keygen -s ${CERTIFICATE} -I ${GITHUB_USERNAME} -n ${AUTH_PRINCIPAL} -V +${LEASE_TIME} -z ${SERIAL} -O source-address=${ALLOWED_CIDR}…
Briansbum
  • 121
  • 1
  • 5