Tagged Questions
5
votes
3answers
83 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 ...
4
votes
2answers
31 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 in unusual cases (e.g. if the ...
3
votes
1answer
740 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!
#! /bin/sh
#function that checks if dependencies are installed
check_software() {
#check ...
2
votes
2answers
341 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 ...
2
votes
1answer
63 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 means, but give an overview of several ...
2
votes
1answer
115 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 post-receive.d.
My script is as follows
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
DIR="$( dirname "$SOURCE" )"
...
2
votes
2answers
80 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 ...
1
vote
1answer
295 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 ...
1
vote
1answer
150 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 ...
1
vote
1answer
35 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 a symlink to the current jdk'. ...
1
vote
1answer
131 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 ...