Created
January 16, 2017 14:14
-
-
Save pathologicalhandwaving/024d1b4599e9892b4b9caa0bc6331f10 to your computer and use it in GitHub Desktop.
Shell script for adding definitions to a yaml file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FILE="$HOME/School/Classes/MIT6001x/Notes/gloss.yml" | |
| clear | |
| # Get User Input | |
| read -p 'Term: ' term | |
| read -p 'Term Label: ' label | |
| read -p 'Term Description: ' descr | |
| # STDOUT Test | |
| #echo " " | |
| #echo "Term Entered: " $term | |
| #echo "Term Label Entered: " $label | |
| #echo "Term Description Entered: " $descr | |
| #echo " " | |
| # Write to file | |
| echo " " | |
| echo "label: $label" >> $FILE | |
| echo "subvalue:" >> $FILE | |
| echo " term: $term" >> $FILE | |
| echo " description: >" >> $FILE | |
| echo " $descr" >> $FILE | |
| echo " " >> $FILE | |
| # STDOUT Last Entry | |
| cat $FILE | tail -7 | |
| # Exit | |
| exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment