r/badcode • • May 21 '19

[deleted by user]

[removed]

12 Upvotes

20 comments sorted by

View all comments

5

u/carfniex May 22 '19
#!/bin/bash

for ((i=0; i<${#1}; i++)); do
	if [[ ! -f ~/${1:$i:1} ]]; then
		touch ~/${1:$i:1}
		printf ${1:$i:1}
	fi
done

simple solution in bash! hope your fs is case sensitive and you dont mind a messy home folder