Replace spaces with underline in subject script
This commit is contained in:
parent
4779337530
commit
80d0d8433f
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: subject <subject name> <subject type>"
|
||||
echo "subject type 0: programming"
|
||||
|
@ -11,10 +10,11 @@ fi
|
|||
name=$1
|
||||
type=$2
|
||||
|
||||
mkdir -p "$name"/Labs
|
||||
mkdir -p "$name"/Exercises
|
||||
touch "$name"/.project
|
||||
formatted_name=$(echo "$name" | tr -s ' ' '_')
|
||||
mkdir -p "$formatted_name"/Labs
|
||||
mkdir -p "$formatted_name"/Exercises
|
||||
touch "$formatted_name"/.project
|
||||
|
||||
if [ "$type" -eq 0 ]; then
|
||||
mkdir -p "$name"/Code
|
||||
mkdir -p "$formatted_name"/Code
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue