我們需要打印出AWK/bash的報價:回聲
目標ID = 「123」
AssayID = 「456」 打印\,
awk -F\", 'BEGIN{FS=",";OFS=",";} {print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$12}' VrtAssay_123_target_456_assay_Detail2.csv > VrtAssay_123_target_456_assay_Detail2_reorder.csv
答:我們嘗試:
printf "awk -F"\""," 'BEGIN{FS=\",\";OFS=\",\";} {print \$1,\$2,\$3,\$4,\$5,\$6,\$7,\$8,\$9,\$10,\$11,\$20,\$12,\$13,\$14,\$15,\$16,\$17,\$18,\$19}' VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail2_average.csv > VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail3.csv"
B.或回波
echo "awk -F"\"", 'BEGIN{FS=\",\";OFS=\",\";} {print \$1,\$2,\$3,\$4,\$5,\$6,\$7,\$8,\$9,\$10,\$11,\$20,\$12,\$13,\$14,\$15,\$16,\$17,\$18,\$19}' VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail2_average.csv > VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail3.csv"
均可以得到(\消失)
awk -F", 'BEGIN{FS=",";OFS=",";} {print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$12}' VrtAssay_123_target_456_assay_Detail2.csv > VrtAssay_123_target_456_assay_Detail2_reorder.csv
C.如果我們試圖
printf "awk -F\\", 'BEGIN{FS=\",\";OFS=\",\";} {print \$1,\$2,\$3,\$4,\$5,\$6,\$7,\$8,\$9,\$10,\$11,\$20,\$12,\$13,\$14,\$15,\$16,\$17,\$18,\$19}' VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail2_average.csv > VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail3.csv"
如果我們試圖
這些會給Unmatched ".
D的錯誤信息
echo "awk -F\\", 'BEGIN{FS=\",\";OFS=\",\";} {print \$1,\$2,\$3,\$4,\$5,\$6,\$7,\$8,\$9,\$10,\$11,\$20,\$12,\$13,\$14,\$15,\$16,\$17,\$18,\$19}' VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail2_average.csv > VrtAssay_${TargetIDs}_target_${AssayID}_assay_Detail3.csv"
這給了我們
Unmatched ".
想知道任何大師可以提供一些解決方案嗎?
,請注意,是因爲它被用來逃避以下'「'反斜線走了 – Eevee
@Henry什麼是您的實際。問題?爲什麼你改變了這個問題?如果你有任何其他疑問,試着把它作爲另一個問題。 –