我怎样才能用 AIX 脚本正确地写这个?我的要求是在 test.txt 中写这个命令:
clock=$(prtconf -s | awk '{print $4,$5}')
Run Code Online (Sandbox Code Playgroud)
我试过这个命令:
print 'clock=$(prtconf -s | awk '{print $4,$5}')' > test.txt
Run Code Online (Sandbox Code Playgroud)
写在 test.txt 中的输出给了我:
clock=$(prtconf -s | awk {print ,})
Run Code Online (Sandbox Code Playgroud)
如果我使用" "引号:
print "clock=$(prtconf -s | awk '{print $4,$5}')"
Run Code Online (Sandbox Code Playgroud)
它直接让我:
clock=3612 MHz
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?