Change all scripts to use the BASH interpreter, as some SH versions do not
handle a lot of things correctly.
This commit is contained in:
parent
e3a2efdb43
commit
33ca0e1422
11 changed files with 30 additions and 16 deletions
17
README.md
17
README.md
|
|
@ -1,4 +1,6 @@
|
||||||
---*This project is still under heavy development!*---
|
---*This project is still under heavy development!*---
|
||||||
|
Please do not delete this file, as it is used to display help information.
|
||||||
|
|
||||||
# L A C K A D A I S I C A L
|
# L A C K A D A I S I C A L
|
||||||
A collection of easy-to-understand, easy-to-use scripts, functions and aliases. Designed to be beginner-friendly but also useful!
|
A collection of easy-to-understand, easy-to-use scripts, functions and aliases. Designed to be beginner-friendly but also useful!
|
||||||
|
|
||||||
|
|
@ -54,11 +56,16 @@ These are the included binaries and utilities:
|
||||||
tool quits and simply returns the filename. This
|
tool quits and simply returns the filename. This
|
||||||
can be used in personal workflows to stall a longer
|
can be used in personal workflows to stall a longer
|
||||||
command that relies on the existence of said file.
|
command that relies on the existence of said file.
|
||||||
- newday:
|
- agenda:
|
||||||
A basic but powerful journaling system. Recommended
|
Sets up a folder that is backed by a date-based tree
|
||||||
to be set up via crontab. Can be used for everything
|
directory structure. Requires an argument for the name
|
||||||
from diaries to general file storage to even BTRFS
|
of the folder to generate. Generates a symlink in this
|
||||||
snapshots.
|
name to a date sub-folder in a local '.daisy' folder.
|
||||||
|
Format is <dir> -> .daisy/<dir>/<year>/<month>/<day>.
|
||||||
|
Recommended to run via crontab - automatically cleans
|
||||||
|
up empty folders.
|
||||||
|
Can be used for everything you'd like to sort by date.
|
||||||
|
For example; a diary, browser downloads, backups, code.
|
||||||
- own:
|
- own:
|
||||||
A simple utility. It's effectively an alias for
|
A simple utility. It's effectively an alias for
|
||||||
"sudo chown -R user:user" on the target dir/file.
|
"sudo chown -R user:user" on the target dir/file.
|
||||||
|
|
|
||||||
2
binbox
2
binbox
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# binbox: Creates a multi-binary script that self-contains the input scripts.
|
# binbox: Creates a multi-binary script that self-contains the input scripts.
|
||||||
# Symlinking to the resulting binary with the name of one of the original scripts will trigger
|
# Symlinking to the resulting binary with the name of one of the original scripts will trigger
|
||||||
# said script. The idea is similar to `busybox`.
|
# said script. The idea is similar to `busybox`.
|
||||||
|
|
|
||||||
2
calm
2
calm
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Calm a process down
|
# Calm a process down
|
||||||
# NEEDS_WORK: cleanup
|
# NEEDS_WORK: cleanup
|
||||||
# calm <pid> == only one process
|
# calm <pid> == only one process
|
||||||
|
|
|
||||||
2
cdz
2
cdz
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ $LD_INTERNAL -ne 1 ]];
|
if [[ $LD_INTERNAL -ne 1 ]];
|
||||||
then
|
then
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,15 @@ fi
|
||||||
# Check for dependencies
|
# Check for dependencies
|
||||||
function daisy_dependency_check
|
function daisy_dependency_check
|
||||||
{
|
{
|
||||||
command -v $1 1>/dev/null 2>/dev/null;
|
BIN=$(command -v $1 2>/dev/null)
|
||||||
res=$?
|
res=$?
|
||||||
|
|
||||||
|
BIN=$(basename $BIN 2>/dev/null)
|
||||||
|
|
||||||
|
if [[ $BIN == $1 ]]; then
|
||||||
|
res=1
|
||||||
|
fi
|
||||||
|
|
||||||
echo $(($res ^ 1))
|
echo $(($res ^ 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
editx
2
editx
|
|
@ -1,4 +1,4 @@
|
||||||
# !/bin/sh
|
# !/bin/bash
|
||||||
# This utility pre-allocs a file and adds execution permissions. It also
|
# This utility pre-allocs a file and adds execution permissions. It also
|
||||||
# removes the resulting file if it is empty after the editor closes.
|
# removes the resulting file if it is empty after the editor closes.
|
||||||
|
|
||||||
|
|
|
||||||
2
filewait
2
filewait
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# A simple utility that waits for a file to become available, infinitely
|
# A simple utility that waits for a file to become available, infinitely
|
||||||
|
|
||||||
LD_INTERNAL=1
|
LD_INTERNAL=1
|
||||||
|
|
|
||||||
2
newday
2
newday
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# This script is intended to be run via cron.
|
# This script is intended to be run via cron.
|
||||||
|
|
||||||
# It creates a folder structure in home for the current date in the following format:
|
# It creates a folder structure in home for the current date in the following format:
|
||||||
|
|
|
||||||
2
own
2
own
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Simple program that changes ownership to the current
|
# Simple program that changes ownership to the current
|
||||||
# user, recursively.
|
# user, recursively.
|
||||||
|
|
||||||
|
|
|
||||||
2
sw
2
sw
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# It just swaps two files
|
# It just swaps two files
|
||||||
|
|
||||||
export LD_INTERNAL1
|
export LD_INTERNAL1
|
||||||
|
|
|
||||||
2
what
2
what
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Where is the binary?
|
# Where is the binary?
|
||||||
# Usage: what [<keyword>]
|
# Usage: what [<keyword>]
|
||||||
# Returns:
|
# Returns:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue