mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 14:43:08 +02: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
|
||||
|
||||
name=`basename $0`
|
||||
|
||||
help()
|
||||
{
|
||||
echo "-l <dir/file names...> -> lowerize file/folder name"
|
||||
@ -19,6 +21,12 @@ help()
|
||||
|
||||
uppercase()
|
||||
{
|
||||
if test "$1" = $name
|
||||
then
|
||||
error_msg "you cannot modify name of this script!"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
|
||||
if test -z "$1"
|
||||
then
|
||||
@ -42,6 +50,11 @@ uppercase()
|
||||
|
||||
lowercase()
|
||||
{
|
||||
if test "$1" = $name
|
||||
then
|
||||
error_msg "you cannot modify name of this script!"
|
||||
exit 3
|
||||
fi
|
||||
if test -z "$1"
|
||||
then
|
||||
error_msg "missing filename for -l"
|
||||
@ -60,6 +73,11 @@ lowercase()
|
||||
|
||||
sneed()
|
||||
{
|
||||
if test "$2" = $name
|
||||
then
|
||||
error_msg "you cannot modify name of this script!"
|
||||
exit 3
|
||||
fi
|
||||
if test -z "$1"
|
||||
then
|
||||
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