我们可以编写简单的 bash 脚本以多种方式简化我们的任务。例如作为下面的 bash 脚本。
#!/bin/bash
name="Vijay"
echo "My name is $name."
echo "$name does no like to play football"
exit $?
可以在 Fortran 中实现相同的目标吗?我尝试了代码作为打击:
program simple
implicit none
character(len=1024),parameter :: name="Vijay"
write (name,"(A5)")
print*, "My name is trim(name)"
print*, "trim(name) does no like to play football"
end
但是,我收到错误消息:
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER variable
感谢任何帮助解决此问题。
提前致谢