From 73c2b00a10c5786ddeeacc915e233fd4df1c9321 Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Sat, 11 Oct 2025 22:19:00 +0200 Subject: fix: evalexpr & tinyprintf contenaient toute la piscine --- rushs/tinyprintf/alphanum/alphanum.sh | 53 ----------------------------------- 1 file changed, 53 deletions(-) delete mode 100755 rushs/tinyprintf/alphanum/alphanum.sh (limited to 'rushs/tinyprintf/alphanum/alphanum.sh') diff --git a/rushs/tinyprintf/alphanum/alphanum.sh b/rushs/tinyprintf/alphanum/alphanum.sh deleted file mode 100755 index e4c5aee..0000000 --- a/rushs/tinyprintf/alphanum/alphanum.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -letters() -{ - grepped=$(echo "$1" | grep -E "^[a-zA-Z]+$") - [ "$1" = "$grepped" ] && return 0 || return 1 -} - -empty() -{ - if echo "$1" | grep -qE '^[[:space:]]+$'; then - return 0 - fi - return 1 -} - -digit() -{ - grepped=$(echo "$1" | grep -E "^[0-9]$") - [ "$1" = "$grepped" ] && return 0 || return 1 -} - -number() -{ - grepped=$(echo "$1" | grep -E "^[1-9][0-9]+$") - [ "$1" = "$grepped" ] && return 0 || return 1 -} - -alph() -{ - grepped=$(echo "$1" | grep -E "^[a-zA-Z0-9]+$") - [ "$1" = "$grepped" ] && return 0 || return 1 -} - -while IFS='' read -r str; do - if [ -z "$str" ]; then - echo it is empty - continue - elif letters "$str"; then - echo "it is a word" - elif number "$str"; then - echo "it is a number" - elif digit "$str"; then - echo "it is a digit" - elif empty "$str"; then - echo "it is empty" - elif alph "$str"; then - echo "it is an alphanum" - else - echo "it is too complicated" - exit - fi -done -- cgit v1.2.3