Skip to content

Instantly share code, notes, and snippets.

@arifsuhan
Created September 25, 2020 05:44
Show Gist options
  • Save arifsuhan/11bf2699a7a489062fba200e40e0f3c2 to your computer and use it in GitHub Desktop.
Save arifsuhan/11bf2699a7a489062fba200e40e0f3c2 to your computer and use it in GitHub Desktop.

This will helps one to generate base code template.

Bash Script

temp="class "$*"{ \n 
\tpublic static void main(String[] args){ \n
\t\tSystem.out.println(""); \n
\t} \n
}"

save_path=$(pwd)"/"$*".java"
echo $temp > $save_path

echo $*".java created successfully"

Command

java_template.sh [filename]

From shell

alias j="sh /Users/arifsuhan/java_template.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment