Skip to content

Instantly share code, notes, and snippets.

@AdryDev92
Created March 20, 2019 23:15
Show Gist options
  • Save AdryDev92/014574fbb9f3cd4c851f4427c0cee161 to your computer and use it in GitHub Desktop.
Save AdryDev92/014574fbb9f3cd4c851f4427c0cee161 to your computer and use it in GitHub Desktop.
A simple script to create a file with a text of your choose in the location you want
#! /bin/zsh
#if you use bash, simply change /bin/zsh to /bin/bash
if [ "$1" = "-h" ]; then
echo "The correct way to use this script:
[arg1] = file name
./create-file [arg1]"
exit 0
fi
echo "Write the name of file:"
read filename
echo "This is a random text that you can change for what you want" >> $filename.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment