[recursive.sh]: add recursive.sh

A script that calls itself
This commit is contained in:
2024-08-08 23:36:54 +01:00
parent b24751b996
commit a6b58f4d9d
2 changed files with 7 additions and 0 deletions

View File

@ -3,4 +3,5 @@ This repository was created as a sister repository to the more practical [`utili
repository to house scripts that were not useful enough to earn a place in there.
## Overview of Scripts
- `recursive.sh`: a script that calls itself
- `suicidal_script.sh`: a script that deletes itself.

6
recursive.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# A script that calls itself
recursion_count=${1:-0}
echo "Recursion number $recursion_count"
$0 $((recursion_count + 1))