🔧 Modified scrpt to check for file first
This commit is contained in:
parent
88d52fa7a4
commit
4f3a0c000f
1 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
filename=$1
|
filename=$1
|
||||||
|
|
||||||
|
if [[ -f "$filename" ]]; then
|
||||||
|
echo "File: $filename already exists."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
touch "$filename"
|
touch "$filename"
|
||||||
chmod +x "$filename"
|
chmod +x "$filename"
|
||||||
echo "#!/usr/bin/env bash" >> "$filename"
|
echo "#!/usr/bin/env bash" >>"$filename"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue