所以我试图用管道覆盖:
//reads contents of file| turns lowercase to uppercase | changes $ to # |
// then attempts to overwrite original file with new version
cat cutTester.txt|tr '[a-z]' '[A-Z]'|tr '$' '#' >cutTester.txt
但是当我这样做时它只是擦除文件。这是文件的内容
$first$second$third$fourth
$fifth$sixth$seventh$eighth
$ninth$tenth$eleventh$twelveth
$thirteenth$fourthteenth$fifthteenth$sixthteenth
$seventeenth$eightteenth$nineteenth$twenty
$twenty-one$twenty-two$twenty-three$twenty-four
1
请参阅有关''>''的警告。
—
斯科特