tcsh ファイルの実行に関する問題

tcsh ファイルの実行に関する問題

次のプログラムを実行できません。実行しようとすると、次のように表示されます。

set goal = `head -c 15 < /dev/urandom | base64 | sed 's/[^0-9]//g' | sed'
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].

私のプログラムコードは次のとおりです。

#!/bin/tcsh -f
echo "guess the number"
set answer = $<
set goal = `head -c 15 < /dev/urandom | base64 | sed 's/[^0-9]//g' | sed 's/\(.\).*/\1/'` 
set count = 1
while ($answer != $goal )
   if ($answer < $goal ) then echo "too small"
   else
      echo "too large"
   endif
   @ count ++
   set answer = $<
end
echo "correct!"
echo "using $count rounds"

ベストアンサー1

おすすめ記事