Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
実際には、シェルスクリプトを使用して「folder-a」から「folder-b」にファイルをコピーしたいと考えています。たとえば、「folder-a」には4つのファイルが含まれています。file1 file2 file3 file4 ただし、宛先にコピーするとき、スクリプトはユーザーに各ファイルの名前を変更するように要求し、スクリプトはそれを新しい名前で「folder-b」にコピーします。
次のスクリプトを記述します。
#!/bin/sh for f in $1/*; do read -p "New name for $f:" g scp $f $2/$g done
そして、コマンドラインで:
./my-script.sh folder-a folder-b