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
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 :)