diff --git a/mysqlcsv b/mysqlcsv index 2fe50b0..3430a2b 100755 --- a/mysqlcsv +++ b/mysqlcsv @@ -100,6 +100,10 @@ if [ "$1" != "--" ]; then query="$1"; shift fi +if [ -n "$input" -a "$input" != "-" ]; then + [ -f "$input" ] || die "$input: fichier introuvable" +fi + if [ -n "${configs[*]}" ]; then PROFILE="$profile" array_fix_paths configs diff --git a/mysqlloadcsv b/mysqlloadcsv index 66e2946..45c9773 100755 --- a/mysqlloadcsv +++ b/mysqlloadcsv @@ -112,6 +112,10 @@ if [ -n "${configs[*]}" ]; then fi [ -n "$table" ] || die "Vous devez spécifier la table dans laquelle se fera l'importation" +if [ -n "$input" -a "$input" != "-" ]; then + [ -f "$input" ] || die "$input: fichier introuvable" +fi + isnum "$skip_lines" || skip_lines=0 if [ -n "${fields[*]}" ]; then