BASH is the GNU Bourne Again SHell, the successor to the classic Unix Bourne sh (shell). It's the default shell for various GNU systems.

learn more… | top users | synonyms

1
vote
0answers
12 views

Workflow / pipeline management on SLURM cluster

I'm a PhD student in bioinformatics, but with a background in pure biology (i.e. very little programming), and I have a pipeline for analysing commonly available bioinformatic datasets, starting with ...
0
votes
0answers
26 views

Find multiple values from reference csv in data csv [closed]

I have approx. 0 coding knowledge and I am trying to do the following: I have a file with around 100 genes, each one in a new line: Example Reference-file ...
1
vote
1answer
26 views

Finding the second highest version using bash array script and clean up files

The goal is to print the highest version and second highest version of the list of files. The version is based on the first three digit places of the version. For example, version 2.3.0.1 version is ...
0
votes
0answers
14 views

grep local and grep not, not, not [closed]

This statement "grep -v -i local" is everywhere on the internet. It is used in a chain of commands that reduce the number of locales installed (& so footprint ...
3
votes
1answer
46 views

Bash script to run development tasks for configured projects

I wrote this script template at work to save typing repetitive commands and to improve my Bash-fu. I intend to share the runcom with my coworkers, so I'd also like to know of any moderate-to-severe ...
4
votes
0answers
30 views

Selective Time Machine backup deletion

Time Machine is a useful backup service for Mac, but deleting multiple backups is cumbersome. This script allows mass deletion of unwanted backups while allowing specified "important" backups to ...
4
votes
1answer
25 views

Simple Bash Parallel Tool (env_parallel dies on big env)

This is a simple tool to parallelize execution of multiple tasks in Bash, since env_parallel can't handle the environment size (or something of the sort - dies for ...
3
votes
0answers
46 views

Iterating through an array once [closed]

I am tasked with writing a script that analyzes code and attaches a comment with #Loopn or #Selection n that corresponds with ...
8
votes
1answer
838 views

Guessing the JDK home directory

My project is using a specific version of JDK which is jdk-6 and the default JDK_HOME path will vary from distribution to distribution, so I wrote a script to guess it. Is there any way to do this ...
3
votes
1answer
21 views

Get bibtex entries from metadata of PDF files

When I have to write a report or an article, I usually have my bibliography as PDFs in a specific folder, so I wrote this script to automate the generation of bibtex entries. It works so far, but I'd ...
1
vote
1answer
76 views

Simple Linux upgrade script in Bash revision 2

As I will be deploying this script on multiple machines with the very same system Linux Mint 18 with rather same configuration, I would like to be semi-sure I won't screw things up much. This little ...
6
votes
1answer
82 views

Simple Linux upgrade script in Bash

As I will be deploying this script on multiple machines with the very same system Linux Mint 18 with rather same configuration, I would like to be semi-sure I won't screw things up much. This little ...
2
votes
1answer
20 views

Script to execute arbitrary command on each Git project in a directory

The idea is simple, most people have some one directory containing all their projects as subdirectories. When you are in the top directory and you run this script like so ...
4
votes
2answers
63 views

Optimize text search in files with Bash

I would like to get some performance improvement suggestions to a simple project I made using Bash in Linux. The target is to read all the *.desktop files, and ...
3
votes
1answer
36 views

ECG Bash selection tool

I made the following bash script for extracting a group of ECG signals from ECG files. I would like to know if there is any mistakes and/or weaknesses. I have experienced difficulties in integrating ...
1
vote
2answers
43 views

Excluding a long list of words with grep

This Bash program extracts the 20 first lines of each man page present on a system and uses grep to remove lines matching a list ...
3
votes
0answers
43 views

Daemonizing shell scripts - MqSH

This is an mqtt driven, interactive, and asynchronous remote shell daemon written in bash. I call it "MqSH" or simply "mq". It works with bash, the busybox ash shell, and perhaps other Bourne-like ...
3
votes
1answer
28 views

OpenVPN Authentication Script

I wrote a shell script to authenticate users connecting to an OpenVPN server. When a user attempts to connect, OpenVPN executes the script with the username and password variables sends. The script ...
4
votes
0answers
30 views

Semaphore implementation by file locking in a bash script

This implementation is inspired by the POSIX functions sem_wait() and sem_post(). It tries to get rid of busy loops in the code ...
5
votes
1answer
65 views

Game of Life Kata in Bash

I've implemented a Game of Life Kata with the aim to get to know Consul's K/V store. Although not the main purpose of the exercise, it would be nice if somebody reviewed some of the bash code in the ...
2
votes
2answers
53 views

Passing help options to a bash script

I used this code to give -h(help) options to my bash script. It's working fine and I wanted to get the code reviewed. ...
3
votes
1answer
28 views

Filetype backup script

This was one of my assignments in which I had to create a backup script that will individually compress all files (of an arbitrary number) of file-types (indicated by their .extension). Example: <...
3
votes
1answer
14 views

Merging directories and keep files that have more lines

Goal My goal is to merge directories. Whenever a file has the same name in two or more directories, then only the one that has the highest number of lines should be kept. If both files have the same ...
3
votes
1answer
54 views

Backup MySQL database for Django projects

I have a usual Django application with a single MySQL database. The purpose of this shell script is to backup a MySQL database every midnight by crontab and check that everything goes right. The ...
4
votes
2answers
63 views

Generate SQL UPDATE from Excel CSV file

I must write updates in a database from a flat file (CSV). I want to do that in the shell, with tools such as AWK. ...
5
votes
1answer
46 views

Bash function that allows running user aliases with sudo on Ubuntu

I wrote this little Bash function to replace my sudo command. It checks whether I have an alias for the given command and runs the aliased command instead of the ...
2
votes
2answers
34 views

High CPU utilisation for Logs Manager shell script

I have written a shell script to manage the tcpdump pcap logs and syslog files in my Linux board, so as to maintain the disk usage to maximum of 70%. The script checks for the disk usage every ...
2
votes
1answer
34 views

Fahrenheit / Celsius temperature converter - follow-up

This is an updated version of the script Fahrenheit / Celsius temperature converter. I have changed the script to be non-interactive, using positional parameters instead of asking for user input once ...
2
votes
0answers
50 views

Log all Google Chrome browser activity

This script documents every website visited and writes the text content of each webpage to its own individual file. It seems to work as intended. Is there anything I could do to improve it? ...
3
votes
1answer
53 views

Bash manual page selection menu

I wrote the following script in the hopes of streamlining the finding and reading of multiple manual pages. Since I am always looking up different utilities' manual pages I thought this would a good ...
3
votes
2answers
52 views

Counting unique visitors in access log

I'm aware I am probably reinventing the wheel somewhat here, but I am trying to teach myself simple bash coding by completing simple tasks such as parsing files. To that end I am looking to learn ...
1
vote
2answers
55 views

Iterating over a range of dates in a shell script

I have been working on a script that can be used to automatically pull the batch ids that were processed 4 days ago and which need to be processed tomorrow on the server. The batch IDs from 3 days ago ...
4
votes
1answer
111 views
5
votes
2answers
405 views

Fahrenheit / Celsius temperature converter

This is a simple bash script (hopefully with a little style as well) for converting temperatures from Fahrenheit to Celsius and vice versa. ...
5
votes
1answer
33 views

Customized date and time display

A simple reworking of the Bash date command to my own personal liking. Possibly a rather trivial task; I just wanted the date and time to be in the form of: ...
4
votes
2answers
60 views

Bash script for setting up a LAN to WLAN router

I wrote a bash script for the Raspberry Pi 3 (Raspbian) which has the main task of setting up a LAN to WLAN router. In addition it makes some things nicer for the intended users who have Windows ...
3
votes
1answer
64 views

Replacing values in json file with jq

I have a JSON file like ...
3
votes
0answers
100 views

Laravel Docker-Compose

I've created a repo for some Docker containers that work together with docker-compose to make a very easy and quick installation for Laravel including nginx, mariadb, and redis. Laravel is known for ...
5
votes
1answer
51 views

`ls` indicates when directory is empty/full of dotfiles

I want ls to print a message when run on an empty or full of dotfiles directory. Instead of: $ ls empty_dir/ dotfiles/ $ I ...
3
votes
1answer
32 views

Moving WordPress database and files to new host

I've written a script in an attempt to try to automate moving hosts from old hosts to our new docker containers. All feedback and input appreciated! ...
3
votes
3answers
66 views

Collect, filter and display archive logs on demand

Wrote a php site to gather/filter/search daily archived logs from the archive directory using bash cat and ...
2
votes
1answer
39 views

Shell script to archive files to AWS S3

This is a simple script that moves files to S3 if they are > 14 days old. It ignores files that are < 14 days old. If the file is successfully synced to AWS S3 then we can remove it from the server....
0
votes
0answers
52 views

Robust bash function to find the root of a git repository

I'm trying to write robust code which will print the root directory of a git repository. How can I improve this code for: Robustness Style (eg use of subshell ...
6
votes
1answer
47 views

Extracting Linux configuration information using Bash and Perl

For few days I'm thinking about making my code faster and using less CPU. This code is a statusbar that runs in a loop. I'm asking because there's a lot of perl and I'm wondering if it could be done ...
2
votes
1answer
149 views

Shell script wrapper for Docker build and run

I have written a simple wrapper for docker build and docker run that allows me to build and run my image without having to use ...
6
votes
1answer
148 views

Coloured bash prompt including git status and previous exit code

I wanted to create a short, informational and colourful prompt. My prompt includes: Exit status of last command (if not 0) Distinctive changes when root rsync-...
4
votes
1answer
33 views

Yum Notification Script

This is a Bash script I wrote to email me when updates are available for my server. I'm new to bash programming, so I don't know if I've done this well. ...
5
votes
1answer
17 views

Script to record an inventory of a backup

This is a script designed to make an inventory file which records the contents of a directory allowing verification that a backup has the same data. The same script can also A full github repo is ...
4
votes
1answer
56 views

Server setup script for Redis, HAProxy and Node.js

I wrote a pretty basic setup script that handles most of the setup for a Three-server solution. The solution and setup file are available on GitHub The three servers are Redis, HAProxy and Node / ...
6
votes
3answers
90 views

Bash script to extract HTML comment into a Markdown file

I learned Bash a million years ago. I just wrote this simple script used to get the first lot of HTML comments from a file, and spit it out in order to create a ...