Interacting with files from multiple directories via bash script

前端 未结 2 727
时光说笑
时光说笑 2021-01-22 15:37

I generated a script that iterates through several .csv files, converting relevant files to UTF-8:

#!/bin/bash

cd /home/user/prod/
charset=\"text/plain; charset         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-22 16:02

    You stop the glob from being expanded when you quote it in

    for file in "$path/*.csv"; do
    

    Instead, quote the expansion but not the glob:

    for file in "$path"/*.csv; do
    

提交回复
热议问题