import.sh 196 B

12345678910
  1. #!/bin/bash
  2. export PGPASSWORD=$4
  3. host=$1
  4. port=$2
  5. username=$3
  6. dbname=$5
  7. table=$6
  8. filename=$7
  9. psql -h ${host} -p ${port} -U ${username} -d ${dbname} -c "\\copy ${table} from ${filename} with csv;"