S
S
sprofxx2019-02-11 23:41:40
bash
sprofxx, 2019-02-11 23:41:40

cat to a variable. freebsd?

I am writing a bash script, I want to get a two-digit random number to put it in sleep. I write like this in the sss.sh script:

ss=`cat /dev/urandom | tr -d -c '0-9' | fold -w 10 | head -1 | awk '{print substr($0, 1, 2)}'`
echo ss

result:
sh sss.sh
ss

Can you please tell me how to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-02-11
@sprofxx

echo $ss

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question