Created
September 2, 2025 20:18
-
-
Save waptik/c6f7d32d62840ad0bf5b0e0fd9d8c6e0 to your computer and use it in GitHub Desktop.
creates 25 empty files for <your_name><numer> each time it runs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| NAME="stephane" | |
| last_num=$(ls scripts/${NAME}[0-9]* 2>/dev/null | sed "s/[^0-9]//g" | sort -n |$ | |
| echo $last_num | |
| if [ -z "$last_num" ]; then | |
| last_num=0 | |
| fi | |
| echo $last_num | |
| for number in {1..25}; do | |
| updated_num=$((last_num + number)) | |
| touch scripts/$NAME$updated_num | |
| done | |
| ls -l scripts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment