How can I write a bash script that: Takes a series of filenames provided by the user and moves them into their own new directory?
CODE:
OUTPUT:
RAW CODE:
#!/bin/bash
read -p 'File Names: ' files # Taking series of file names from user
read -p 'Directory: ' dir # Taking new directory name from user
mkdir $dir # creating new directory
mv $files $dir # moving files to new directory.
NOTE:
If You have any doubts feel free to comment in comment
section.
DO VOTE(LIKE).
Get Answers For Free
Most questions answered within 1 hours.