私はfstab
にエントリを追加したいと私は私の/bin/bash
スクリプトでこのコマンドを使用しています:配管エコー、尾やsedのリード
echo -n | tail -1 /mnt/etc/fstab | sed 's/\(-\).*/-03/' >> /mnt/etc/fstab
echo -e -n "\t" >> /mnt/etc/fstab
echo -n "/home" >> /mnt/etc/fstab
echo -e -n "\t" >> /mnt/etc/fstab
echo -n "ext4" >> /mnt/etc/fstab
echo -e -n "\t" >> /mnt/etc/fstab
echo -n "default,noatime" >> /mnt/etc/fstab
echo -e -n "\t" >> /mnt/etc/fstab
echo -n "0" >> /mnt/etc/fstab
echo -e -n "\t" >> /mnt/etc/fstab
echo "2" >> /mnt/etc/fstab
これは、オリジナルコンテンツです:
proc /proc proc defaults 0 0
PARTUUID=ee397c53-01 /boot vfat defaults 0 2
PARTUUID=ee397c53-02/ ext4 defaults,noatime 0 1
、これが予想される出力です:
proc /proc proc defaults 0 0
PARTUUID=ee397c53-01 /boot vfat defaults 0 2
PARTUUID=ee397c53-02/ ext4 defaults,noatime 0 1
PARTUUID=ee397c53-03 /home ext4 defaults,noatime 0 2
代わりに出力がfolloですウィング:
proc /proc proc defaults 0 0
PARTUUID=ee397c53-01 /boot vfat defaults 0 2
PARTUUID=ee397c53-02/ ext4 defaults,noatime 0 1
PARTUUID=ee397c53-03
/home ext4 default,noatime 0 2
パイピングで何が問題になっていますか?