Search Results

Search: Posts Made By: lsecer
2,484
Posted By Corona688
OK. Since you have bash, you have string...
OK.

Since you have bash, you have string operations, so:

#!/bin/bash

STR="kitten"
GUESS="${STR//[a-z]/_}" # Replace all [a-z] with _

while [ "$GUESS" != "$STR" ]
do
IN=""
...
1,503
Posted By clx
One way: $ word=hello $ guess=adhewlso $...
One way:

$ word=hello
$ guess=adhewlso
$ echo $word | fold -1 | sort -u | awk -v guess=$guess '{ m=match(guess,$0); if ( m == 0 ) { exit 1}}'
$ echo $?
0
$ guess=xyzhel
$ echo $word | fold...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy