Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #-------------------------------------------------------------------------------
- # PARAMETERS:
- # $@ - cp arguments
- #-------------------------------------------------------------------------------
- get_last_arg() {
- shift $(($# - 1)) && # skip all arguments expect the last one
- echo "$1" # print it
- }
- last_arg="$(get_last_arg "$@")" && # get the target directory
- mkdir -p -- "$last_arg" && # create the target directory
- cp "$@" # copy files to the created directory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement