问题描述:
试计算在区间 1到 n的所有整数中,数字x (0<=x<=9)共出现了多少次?
例如,在 1到11中,即在 1,2,3,4,5,6,7,8,9,10,11 中,数字 1 出现了 4 次。
输入:
11 1
输出:
4
shell代码描述:
#!/bin/bash
read n x
number = ‘seq 1 ${n} | grep -o ${x} | grep -c ${x}’
echo ${number}
问题:
number: command not found
把number当做命令了