mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-11 14:07:39 +01:00
fix: you cannot modify modify.sh script name
This commit is contained in:
parent
4fded48e8d
commit
6c2529b264
0
EOPSY/LOWERCASEFOLDERMAIN/LOWERFILESUB
Normal file
0
EOPSY/LOWERCASEFOLDERMAIN/LOWERFILESUB
Normal file
0
EOPSY/RECURSEFILE
Normal file
0
EOPSY/RECURSEFILE
Normal file
0
EOPSY/UPPERFOLDERMAIN/UPPERFILESUB
Normal file
0
EOPSY/UPPERFOLDERMAIN/UPPERFILESUB
Normal file
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
# the name of the script without a path
|
# the name of the script without a path
|
||||||
|
|
||||||
|
name=`basename $0`
|
||||||
|
|
||||||
help()
|
help()
|
||||||
{
|
{
|
||||||
echo "-l <dir/file names...> -> lowerize file/folder name"
|
echo "-l <dir/file names...> -> lowerize file/folder name"
|
||||||
@ -19,6 +21,12 @@ help()
|
|||||||
|
|
||||||
uppercase()
|
uppercase()
|
||||||
{
|
{
|
||||||
|
if test "$1" = $name
|
||||||
|
then
|
||||||
|
error_msg "you cannot modify name of this script!"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -z "$1"
|
if test -z "$1"
|
||||||
then
|
then
|
||||||
@ -42,6 +50,11 @@ uppercase()
|
|||||||
|
|
||||||
lowercase()
|
lowercase()
|
||||||
{
|
{
|
||||||
|
if test "$1" = $name
|
||||||
|
then
|
||||||
|
error_msg "you cannot modify name of this script!"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
if test -z "$1"
|
if test -z "$1"
|
||||||
then
|
then
|
||||||
error_msg "missing filename for -l"
|
error_msg "missing filename for -l"
|
||||||
@ -60,6 +73,11 @@ lowercase()
|
|||||||
|
|
||||||
sneed()
|
sneed()
|
||||||
{
|
{
|
||||||
|
if test "$2" = $name
|
||||||
|
then
|
||||||
|
error_msg "you cannot modify name of this script!"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
if test -z "$1"
|
if test -z "$1"
|
||||||
then
|
then
|
||||||
error_msg "missing sed pattern"
|
error_msg "missing sed pattern"
|
||||||
|
|||||||
0
EOPSY/recurselowerfile
Normal file
0
EOPSY/recurselowerfile
Normal file
0
EOPSY/sedlowercasefoldermain/sedlowerfilesub
Normal file
0
EOPSY/sedlowercasefoldermain/sedlowerfilesub
Normal file
0
EOPSY/sedrecursefile
Normal file
0
EOPSY/sedrecursefile
Normal file
Loading…
Reference in New Issue
Block a user