Skip to content

Instantly share code, notes, and snippets.

@tom-a
Last active May 1, 2020 02:35
Show Gist options
  • Save tom-a/ebecf5dc65961f42d3d93c1486551ac2 to your computer and use it in GitHub Desktop.
Save tom-a/ebecf5dc65961f42d3d93c1486551ac2 to your computer and use it in GitHub Desktop.
#!/bin/zsh
if [ $# -ne 1 ]; then
echo "引数がありません" 1>&2
exit
fi
file="${1##*/}"
dir="${1%/*}"
dir="${dir#./}"
echo $dir
echo $file
cp -p $1 $dir-$file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment