geschätzt werden können, verwenden Sie etwas wie:
#!/bin/bash
#SET /p equivalent in linux is "read -p"
read -p 'Please enter SOURCE dir (ex: /root/source/) : ' source
read -p 'Please enter DESTINATION dir (ex: /root/destination/) : ' destination
#xcopy /w : Displays the following message and waits for your response before starting to copy files:
#Press any key to begin copying file(s)
read -r -p "Copy $source to $destination? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
#cp -i, --interactive: prompt before overwrite
#cp -R, -r, --recursive: copy directories recursively
cp -i -r $source $destination
else
echo "Aborted"
fi
Meinst du 'bash'? Ich denke, "Shell" ist ein allgemeiner Begriff, OS-Agnostiker (cmd.exe kann als eine Shell betrachtet werden, obwohl es wahr ist, dass oft mehr Linux bezogen). – kebs
Verwenden Sie ** wirklich ** MS-DOS? Oder beziehst du dich auf die Befehlszeile in Windows? –
Sorry editiert es, ich meinte bash und cmd skripte @kebs –