【发布时间】:2022-08-17 19:09:55
【问题描述】:
我有一个比较堆内存的脚本
#!/bin/bash
$a=$(jcmd `jps -l | grep com.adobe.coldfusion.bootstrap.Bootstrap | cut -f1 -d \' \'` GC.heap_info | awk \'NR==2 {print $5}\')
$b=1000000K
if [[ $a -ge $b ]]
then
echo \"The heapmemory used is greater.\"
else
echo \"The heapmemory used is small.\"
fi
我的问题是当我使用./testscriptforheap.sh 执行这个脚本时,虽然输出是正确的,但是为什么我在第 2 行和第 3 行中找不到这个命令,我无法弄清楚。
> ./testscriptforheap.sh: line 2: =1603644K: command not found
> ./testscriptforheap.sh: line 3: =1000000K: command not found
使用的堆内存更大。