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

2
votes
2answers
28 views

Simple Command Line Password Manager

Kruptos is a simple tool that encrypts and decrypts the ~/.kruptos directory with the password that is stored in ...
3
votes
0answers
21 views

Bash manual page selection menu (version 2)

This is update to a previously asked question Bash manual page selection menu. This script generates a menu for the user to select which manual page he/she would like to read. ...
5
votes
0answers
22 views

A shell script to mount a disk image file

I'm trying to create a bash shell script which mounts a disk image file. Not only that but checks to see if the disk image already exists. Is there anyway I could improve my script? Currently my ...
-3
votes
0answers
9 views

Automation script on windows [on hold]

I use a software who produce .txt file in hierarchical structure (parsed in folders subfolder,...) (Zim) and would like to copy and syncronise theses files (let call them twin file) doing some ...
7
votes
2answers
30 views

A replacement for OSX's path_helper

I was having problems setting my path the way I wanted, I turned to Apple's path_helper but found it appends system dirs to the beginning of the path. I found someone had made a start on a replacement ...
5
votes
1answer
29 views

trash script to alias rm

This script implements a command line level trashcan system. Designed to work around rm doing the bits needed to implement a trashcan system at command line level....
9
votes
1answer
78 views

Mass build and save of docker images

I would welcome feedback about this script to automate the building of docker images from a set of dockerfiles. The dockerfiles are provided to the script via stdin. The images are saved to the ...
3
votes
0answers
34 views

Copy recently modified files from one directory to another

I am new to bash scripting. Could you please give a review of this code that copies recently modified files from one directory to another in bash? The main commands are in my ...
2
votes
0answers
18 views

User Login Notifier [closed]

I'm creating a shell script that is supposed to email me whenever a specific user logs in. However, I'm wondering how I would go about doing this for more than one user. This is my code: ...
3
votes
1answer
39 views

Script to check for failed logins and then trawl users' .bash_history for keywords

I have created a script to check for failed logins and then trawl User .bash_history for keywords. There is also processing on the ...
1
vote
1answer
17 views

Checking the status of a ZFS pool

I'd like to see if there are any suggestions on how to improve a simple conditional test at the beginning of a backup script that verifies a ZFS volume is "online" and has the name "tank". For ...
3
votes
1answer
47 views

Showing all programs' man pages

I'm trying to discover useful command line tools in Arch Linux, and it seems one good way of going about that is to look through all of the man pages related to ...
5
votes
0answers
50 views

Safe (and restricted) version of eval

I have built a shell function aimed to perform the following: Given a string as first argument, perform safe expansions (i.e. those that cannot cause arbitrary code execution and only produce string ...
2
votes
0answers
23 views

Chip-8 Emulator in Zsh

I've spent the last few weeks writing a Chip-8 emulator in zsh. It doesn't run in bash but the syntax is nearly identical. I have it on a GitHub repo here: https://github.com/hcorion/chipzsh a ...
6
votes
2answers
127 views

Find prime factors and reverse strings

I'm currently taking an introductory course to Bash at my university, and was hoping to get some peer-review from whoever might have some time. Full disclosure: the quality of the code isn't ...
3
votes
1answer
34 views

Backup a SQLite database

I want to backup a single SQLite database daily up to 30 days back, but I also want to keep at least 2 backups at all times (i.e. if there have been no backups in the last 30 days because the database ...
5
votes
4answers
35 views

Nagios check to see if a certain IP appears in a trace route

I needed a test to know which firewall in out HA environment was currently active. We have a webFilter connected to our "primary" so if the firewall fails over the webfilter is taking out of path and ...
4
votes
1answer
39 views

Bash script prepares virtual environment

I have a few Flask projects that I want to install, each in their own virtual environment. The approach is derived from this tutorial. The steps to create the VE's are very similar, so they're easy to ...
3
votes
2answers
68 views

Bash script to rename subfolder to include name of parent folder

Here's the current structure of my directory. . ├── Show 1 │   ├── Season 1 │   └── Season 2 ├── Show 2    ├── Season 1     └── Season 2 I want to rename the ...
2
votes
0answers
45 views

BASH script to monitor subprocess and throttle it for CPU temperature control

I need to run CPU-intensive tasks on a very old machine with overheating issues. The script below will monitor temperature and pause the jobs when it gets too high, continuing them when it's back to ...
1
vote
1answer
48 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 ...
3
votes
1answer
57 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
33 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
28 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
50 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
848 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 ...
5
votes
1answer
31 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
82 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
121 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
25 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 ...
5
votes
2answers
79 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
47 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
56 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
67 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
45 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
33 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
74 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
58 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
31 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
57 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
70 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
49 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
35 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
35 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
58 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
62 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 ...
4
votes
2answers
58 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
59 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
142 views