Skip to content

Instantly share code, notes, and snippets.

@legeyda
legeyda / foreach
Last active February 9, 2022 15:20
bash script to execute given command in all subdirectories of current directory
#!/usr/bin/env bash
USAGE="Usage:
$0 dir1 dir2 dir2 -- command"
# show help if requested
if [ "x$1" == "x-h" -o "x$1" == "x-?" -o "x$1" == "x--help" ]; then
echo "Execute command in each subdirectory of current directory."
echo "$USAGE"
exit 0
#!/usr/bin/env bash
@legeyda
legeyda / rktup
Last active December 24, 2016 15:05
#!/usr/bin/env bash
# you may try to configure those variables
RKT_VERSION=1.20.0
RKT_PACKAGE_SIZE=95333129
ACBUILD_VERSION=0.4.0
ACBUILD_PACKAGE_SIZE=11864872
# DESTDIR is supported
## get file size. usage: getsize file.txt