c********y 发帖数: 6 | 1 A programmer extends this script to check whether the input is a valid decimal
number. If it isn't, the program outputss
the string"NotANumber"(without quotes). The resulting code is
1 #!.usr.dt.bin.dtksh
2
3 N=${1}
4
5 if ["${N}" -eq"0${N}"] 2>/dev/null
6 then
7
8 dc <
9 ${N}
10 16
11 o
12 p
13 end_of_input
14
15 #Answer to this question
16
17 fi | c********y 发帖数: 6 | 2 No one knows shell commands? I guess that's not a hard question although I
don't know
what the answer is.
decimal
【在 c********y 的大作中提到】 : A programmer extends this script to check whether the input is a valid decimal : number. If it isn't, the program outputss : the string"NotANumber"(without quotes). The resulting code is : 1 #!.usr.dt.bin.dtksh : 2 : 3 N=${1} : 4 : 5 if ["${N}" -eq"0${N}"] 2>/dev/null : 6 then : 7
|
|