The term 'shell' refers to a general class of text-based command interpreters most often associated with the Unix & Linux operating systems.

learn more… | top users | synonyms

7
votes
1answer
57 views

Script for handling PPA's on Ubuntu

I'm writing a bash script to handle the PPA's on Ubuntu & derivatives. I was wondering how to know if I'm handling this the right way. So, the script works (flawlessly), but I posted it to a ...
7
votes
3answers
124 views

Iptables Lockdown

I have nginx serving files with uwsgi and I wanted to lock my server down just to allow SSH and Nginx to run. This is what I have: ...
6
votes
2answers
113 views

Bash script that updates Intel e1000e driver

I am now writing a small bash script that updates an Intel NIC driver to the latest version from the official website. Is there any way to improve\simplify the script? I want to avoid a lot of ...
5
votes
2answers
157 views

Text snippet creator/manager in Bash

Below is a script to create and manage text snippets. It is also posted on GitHub. Most of the code is error checking and displaying help because I wanted to make a solid command line interface. The ...
5
votes
2answers
221 views

Running a shell command and getting output

This is the code I'm currently using to run a shell command on the current machine, intended for use only with GNU/Linux at the moment: ...
1
vote
1answer
71 views

Interactive menu system in Bash [closed]

This is a simple loop menu script that I have for class. The goal was to make a menu with applicable commands. Menu: A. Greet me. (Greet the user by their username (using the whoami ...
3
votes
2answers
67 views

Mixing function parameters, commands and command arguments in Bash functions

I'm trying to write a bash function that will take a command such as xcode-select -v or brew -v that outputs a lot of extra ...
3
votes
2answers
64 views

Parallelizing upload

I needed smth that could send (scp/rsync) many files in parallel but that would not overload machine, firewalls on the way by starting e.g. 600 simultaneous uploads, so upload should be done in ...
4
votes
4answers
57 views

apt alternative for proxy environment with bash shell

As I am new to bash scripting, and want to use apt-get in my university. I know that many people have issues when trying to do so. My focus is simplicity and ease of use, but still need to be ...
1
vote
2answers
63 views

Remove NULL / empty fields using awk

just wanted to check with you could this be done better: ...
2
votes
1answer
145 views

Bash to find all placeholder variables in a file and replace will real variables

I am looking to make a generic config file using variables such as: $PLACEHOLDER_USER Then after moving the file into the correct position I want to replace every instance of *$PLACEHOLDER_VARIABLE* ...
3
votes
1answer
185 views

Make a git repository read-only over ssh depending on the key used

I want a git repository, accessible over ssh, to be read-only when used with certain keys. With other keys access to the full system is okay. Here is my solution. git-readonlyshell: ...
2
votes
1answer
534 views

Send email if URL is down for 2 times only - bash shell script

we want to check if URL is down or not. But sometimes, environment is down for maintenance for 3-4 hours and we dont want to keep sending emails during that time. I have written a shell script for ...
3
votes
0answers
104 views

Project Bashory - Bash History

In effort to be more effective and productive with terminals I have started building a bash script. It is for handling the bash history of concurrently running terminals, archiving old commands, and ...
1
vote
0answers
37 views

zsh system status script

The following script is being used to generate the status line in wmii. I'm curious if there are faster/more efficient ways to find the various info I'm grabbing. I'm also a relative newbie when it ...
1
vote
1answer
58 views

Checking if a git repository needs to be updated

I made a small Vim distribution that uses vundle. I decided to make a small function that checks if the repository must be updated. ...
1
vote
1answer
53 views

Automating the install of postgresql from Shell

When my debian server deploys it can run a shell script so I wanted to make one to install postgreSQL, create a role, create two databases and then import a schema into one. Can anyone please look ...
3
votes
0answers
43 views

A z-shell function to quickly cd into projects

I think we all now that problem. We work with multiple projects: private projects, company projects, probably even projects for multiple companies. From day-one, I've always searched for better ways ...
2
votes
1answer
46 views

Input Columns with Awk

I wrote a small script to manipulate fields of a file based on the input of a user. Is there something I could've done better, or perhaps a better refactor? I do know however that I need a way to ...
1
vote
3answers
78 views

How to improve the computation speed of my shell script/program?

I have written a shell script to process my huge data files (each one having around 7,000,000 lines ~ a weeks data in a single file). Below is the sample of my data file (i.e., input file) structure: ...
2
votes
1answer
143 views

List contents of a folder using a shell script and mail the folder

I want to list the contents of a folder and mail the list using a shell script. I Came up with the following script, please let me know if it is okay: ...
2
votes
1answer
76 views

Bash script to manage multiple Java Development Kits installations

I'm writing a bash script to manage multiple JDKs, the script is very simple, you have to choose a directory when you store all the jdk's, and the script maintain ...
4
votes
1answer
634 views

Bash Shell Script uses Sed to create and insert multiple lines after a particular line in an existing file

This code seems to work, but I'd like someone with shell-fu to review it. Is the temp file a good idea? How would I do without? Is sed the right tool? Any other general advice for improving my ...
3
votes
1answer
195 views

Improve a script to generally check status of several git repos

I've tried to write a bash script that gives me a general overview of the status of git repos I have cloned/created. It's not meant to replace git status by any ...
5
votes
2answers
67 views

Make a directory and change to it

A basic shell function to create a directory and change to it goes like this: mkcd () { mkdir "$1" && cd "$1"; } This works well in many cases but breaks ...
7
votes
3answers
142 views

Can I speed up this simple versioning/backup script?

I'm writing a simple automatic backup/versioning bash script. It should basically mirror a directory structure somewhere, and then copy files over there when they've been altered. The ghost files ...
6
votes
2answers
509 views

Shell script to help with branch management for tasks in git

I found nvie's git branching model simple enough to grasp and suitable for my projects - but the frontend supplied at GitHub was far too complex for me to understand. Hence, I wrote this script to ...
2
votes
1answer
203 views

Run all scripts in a sub-directory

When git runs my post-receive hook, I'd like it to run all the scripts in the subdirectory ...
3
votes
1answer
162 views

Review logic in shell script

I have a shell script to mount different remote systems. While it does work, the area I struggle with (not being a programmer) is the logic of the script: it feels quite stilted and there seems to be ...
3
votes
1answer
2k views

Shell script that verifies checksums when moving between filesystems

I coded this because it seemed like a fun project, would be awesome if someone reviewed this. Thanks! ...
1
vote
1answer
171 views

Converting Bash commands into Windows cmd commands

I have the following code that converts a couple of bash commands into Windows cmd commands, as well as adding some commands. This is only my second day programming ...
1
vote
0answers
160 views

Plan9 rio script to tile windows. How can I improve this (rc-shell)

Here is my window tiling script for rio window manager in plan9. It fetches the current screen size, and calculates the locations based on the layout given. How can I improve this program? am I ...
3
votes
3answers
257 views

Shell script to sync dotfiles repository

I'm doing the git dot files thing and created a script -- my first Unix shell script -- to synchronise the repo dot files with those in the user's home. It checks which dot files exist in the repo ...
1
vote
0answers
79 views

Criticize my first awk program

Consider the following CSV file: A; B; ; B; ; A; C; ; E F; D; ; E; E; C; ; The fields: $1: the jname. A unique id of the entry. $2: a " "(space)-separated list ...
3
votes
2answers
547 views

Script to group files by extension and unzip archives

I am writing a shell script to sort my files by extension and unzip archives. It works in simple cases, but I haven't tested it extensively. How can I make it more robust against the set of file names ...
1
vote
1answer
159 views

CommonJS modules/require at build-time with bash and M4

I've implemented CommonJS Modules 1.1.1 as a simple bash script with a bit of help from M4. I'm interested in comments on the shell scripting and the javascript output. Some specific questions on ...
2
votes
2answers
83 views

Shell script: is it doing what I think it's doing

I've not written many shell scripts and cobbled this together from examples. The 'if' condition should check if this is already running and quite if so. The 'wget' call should trigger the php page and ...
4
votes
1answer
334 views

Transpose a matrix using sed

Transpose the following data from: ...
1
vote
1answer
189 views

Concept for PHP Controlled, Privileged Execution (for a cPanel knockoff on Ubuntu Server)

I was thinking of building a F/OSS project as a cPanel for Ubuntu Server, since Ubuntu doesn't have this, and yet making it easy for a hosting company to use this, where users will find it just as ...
2
votes
1answer
221 views

Collapsing Folder Trees with Ruby

This is a quick script I whipped up to collapse some folder trees down to individual folders. The specific situation that arose was my formerly-itunes collection (it's currently organized ...
4
votes
0answers
479 views

PowerShell Module for formatting objects using Razor

A few days ago I started playing around with PowerShell. I thought a good way to learn would be to try and write a module that allowed formatting objects using the Razor Engine created for ASP.NET. I ...
4
votes
3answers
834 views

Does this shell script look ok?

I don't want anything to execute if any preceding step fails: ...
11
votes
3answers
830 views

Was this shell script ready for open-source? (Random XKCD wallpaper)

I wrote the following little shell script. I published it on GitHub. In the repo there's also a README file that explains how to use it in more detail. This is the first time I open-sourced/published ...