Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Bash script general template to generate script format

#!/bin/bash

#place it in '/bin/template'

echo -e "Enter File Name: c"
read -r file_name

touch ~/test-scripts/$file_name.bash
chmod +x ~/test-scripts/$file_name.bash

echo '#!/bin/bash' > ~/test-scripts/$file_name.bash
echo >> ~/test-scripts/$file_name.bash
echo '# Description:' >> ~/test-scripts/$file_name.bash
echo '# Created Date: 06/7/2022' >> ~/test-scripts/$file_name.bash
echo '# Modified Date: 06/7/2022' >> ~/test-scripts/$file_name.bash
echo '# Auther: Sunny' >> ~/test-scripts/$file_name.bash
echo '# Version: 1.0' >> ~/test-scripts/$file_name.bash
echo >> ~/test-scripts/$file_name.bash
vim ~/test-scripts/$file_name.bash
 
PREVIOUS NEXT
Tagged: #Bash #script #general #template #generate #script #format
ADD COMMENT
Topic
Name
7+8 =