我正在运行一个 bash 脚本,在将文件转换为 zip 之前对其进行整理和组织。当我运行脚本时,会弹出多个 Thunar“警告”和“批评”,我很难弄清楚它们的含义(见图)。当脚本复制文件时会发生这种情况。
它提到了一个我无法放置的奇怪命名文件的内容类型加载错误。是什么产生这些警告?
thunar-WARNING **: 16:45:16.720: Content type loading failed for sedVOTg4r: Error when getting information for file /path/to/file/sedVOTg4r : No such file or directory
GLib-GIO-CRITICAL **: 16:45:16.722: g_file_info_get_attribute_uint32: assertion 'G_IS_FILE_INFO (info)' failed
该脚本如下所示:
#!/bin/bash
subj=$1
outBase=$2
echo $subj
echo $outBase
subj_site_list=path/to/scripts/subj_site_list.txt
######### make/check dir structure exists ########
outStudy=${outBase}/Leapeuaims_2
if [[ ! -d "${outStudy}" ]] ; then
mkdir ${outStudy}
fi
## Set matching site collection for the particular subject
site=$(awk -v search="$subj" '{gsub(/^[ \t]+|[ \t]+$/, "");} $1 == search {print $2}' "$subj_site_list" | tr -d '\r')
echo "${subj} is a ${site} participant"
echo
if [ "$site" = "University1" ]; then
outCentre=${outStudy}/University1
elif [ "$site" = "University2" ]; then
outCentre=${outStudy}/University2
elif [ "$site" = "999" ]; then
echo ">> site code 999, skipping subject $subj"
sed --in-place "/$subj/d" ./logfile.txt
echo ">> site code 999, skipping subject $subj" >> logfile.txt
echo
exit
else
echo ">> subject $subj not listed; check for withdrawn consent"
echo
fi
echo "site parameter set to $outCentre"
echo
if [[ ! -d "${outCentre}" ]] ; then
mkdir ${outCentre}
fi
## Make BOLD folder for preprocessed data
BOLD=${outCentre}/BOLD
if [[ ! -d "${BOLD}" ]] ; then
mkdir ${BOLD}
mkdir ${BOLD}/Preprocessed
fi
####### Check what subj data exists/mk dirs and copy over/rename as needed per modality #########
indir=/path/to/subject_data/$subj/
echo "Wrapping contents ${indir}"
echo
#BOLD
if ls $indir/BOLD_data/preprocessing/* 1> /dev/null 2>&1; then
subjbold=${BOLD}/Preprocessed/${subj}
mkdir $subjbold
rsdir=${subjbold}/Resting_state
mkdir $rsdir
echo "adding preprocessed resting state data"
cp -r $indir/BOLD_data/preprocessing/* $rsdir/
echo "done"
echo
else
echo ">> no preprocessed data found for $subj"
echo
sed --in-place "/$subj/d" ./logfile.txt
echo "${subj}: no fMRI data found" >> logfile.txt
fi