Bash#
Block Highlighting#
Language highlighting can be enabled with PyMdown and Pygments by adding a supported programming language name directly after the first ```
grouping in a Markdown code block:
#!/bin/bash
echo "Today is " $(date)
echo -e "\nenter the path to a directory"
read the_path
echo -e "\nfiles and folders: "
ls $the_path
Block Markdown#
```bash
#!/bin/bash
echo "Today is " $(date)
echo -e "\nenter the path to a directory"
read the_path
echo -e "\nfiles and folders: "
ls $the_path
```
Script adapted from Zaira Hira's "Bash Scripting Tutorial Linux Shell Script and Command Line For Beginners"
Inline Hilighting#
Inline highlighting can be added by prefixing the code snippet with three colons and the name of the supported programming language:
```:::LANGUAGE some code snippet```
or
`:::LANGUAGE some code snippet`
Example:
The read
command can be used to read input from STDIN. Use the array flag -a
to store the provided word sequence as an array:
read -a my_array <<< "hello world"; echo ${my_array[0]}
.
Inline Markdown#
The `:::bash read` command can be used to read input from STDIN. Use the array flag `-a` to store the provided word sequence as an array:
```:::bash read -a my_array <<< "hello world"; echo ${my_array[0]}```.