How delete file from fortran code?

后端 未结 5 1463
有刺的猬
有刺的猬 2021-02-14 00:21

I need to delete a file from a Fortran code. I am on ubuntu 12.04, x86_64. I don\'t understand why the procedure described below does not work. Please

5条回答
  •  旧巷少年郎
    2021-02-14 01:17

    The system call invokes the shell to execute your command, which shell depends on the system/environment. Since you get sh: 1: source: not found, the shell which is invoked doesn't understand the source command, which is a bash builtin. On Ubuntu, by default /bin/sh is linked to /bin/dash, not /bin/bash, and dash does not understand source. Instead, using the . (portable) builtin instead of source:

    100   format('. del.sh ',a30)
    

    should work, if del.sh is in your $PATH.

    This is why I would think that these should all work:

    100 format('sh del.sh ',a30)
    100 format('bash del.sh ',a30)
    100 format('del.sh ',a30)
    

    But you have it differently? In that case, beats me :)

提交回复
热议问题