Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ $# = 0 ]
- then
- cat << END_MY-BALL > my-ball.sh
- cat << TAG_CAT > my-id.txt
- NOM
- Prénom
- adresse@mail.com
- TAG_CAT
- END_MY-BALL
- elif [ $# -gt 1 ]
- then
- if [ ! -f "my-ball.sh" ]
- then
- touch my-ball.sh
- else
- cat /dev/null > my-ball.sh
- fi
- chmod 755 my-ball.sh
- for element in $@
- do
- if [ -f $element ]
- then
- cat << END_MY-BALL > my-ball.sh
- cat $element > "$element.recreated"
- END_MY-BALL
- ./my-ball.sh
- else
- echo "$element : Introuvable"
- fi
- done
- else
- echo "Ce programme n'accepte qu'un seul paramètre au maximum !"
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement