Skip to content

Instantly share code, notes, and snippets.

@bl4ckb0ne
Last active June 20, 2023 06:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bl4ckb0ne/3a79934492114eb812956dd4ec2bbc7e to your computer and use it in GitHub Desktop.
Save bl4ckb0ne/3a79934492114eb812956dd4ec2bbc7e to your computer and use it in GitHub Desktop.
#!/bin/sh
# Program to use the command install recursivly in a folder
magic_func() {
echo "entering ${1}"
echo "target $2"
for file in $1; do
if [ -f "$file" ]; then
echo "file : $file"
echo "installing into $2/$file"
install -D $file $2/$file
elif [ -d "$file" ]; then
echo "directory : $file"
magic_func "$file/*" "$2"
else
echo "not recognized : $file"
fi
done
}
magic_func "$1" "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment