<jupyter_start><jupyter_text>Data Types, Variables and Standard IO Bash script- Bash is dynamic typed programming language- Bash is not a general purpose programming language    - langauge to script bash commands for system administration purpose- use code editor such as VS Code to write bash script- open demo-scripts/hello.sh in an editor (VS Code)- provide executable permission to hello.sh- runt the program```bashchmod u+x hello.sh./hello.sh``` Data types- Bash supports mainly 3 data types: Integer, Float and String  Declaring and using variables- like in any other programming languages variables are used to store data values- syntax to declare variables:```bashvarName=Value```- note not spaces around `=`- Syntax to use variables:```bash$varName```- you can write complete bash script in Jupyter Notebook with Python kernel using `%%bash` magic<jupyter_code>%%bash
var="value" # not a correct way to declare bash variables
echo $var
%%bash
num=100 # int
price=999.123456789 # float
name="<NAME>" # string
person='<NAME>' # string
echo name = $name<jupyter_output>name = <NAME><jupyter_text>Standard output- two commands to write data to standard output/terminal:    - echo    - printf```bashecho literal data and or $variable ```- printf command examples: [https://linuxize.com/post/bash-printf-command/](https://linuxize.com/post/bash-printf-command/)```bashprintf  ```- formats        - %x - hex    - %o - octal    - %d or %i - signed decimal    - %s - string    - %f - float     Note: - echo adds a newline by default; printf doesn't<jupyter_code>%%bash
echo "hi there!"
printf "float data= %.2f  and more data: " 2.3456
printf " good bye! "
# multiple values for single format string
! printf "%.1f\n" 1.44 2.33 3.49 
%%bash
num=100 # int
price=999.123456789 # float
name="<NAME>" # string
person='<NAME>' # string
echo name = $name
printf "Hello %s. Nice meeting you!\n" "$person" # need quotes for values with spaces
printf 'Price of new iphone is $%.3f\n' $price
echo "Mr. ${name}" # can also use curly braces<jupyter_output>name = <NAME>
Hello <NAME>. Nice meeting you!
Price of new iphone is $999.123
Mr. <NAME>
{'fraction_non_alphanumeric': 0.11538461538461539, 'fraction_numerical': 0.025328330206378986, 'mean_word_length': 4.253694581280788, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '619994', 'license': 'MIT', 'n_tokens_mistral': 692, 'n_tokens_neox': 618, 'n_words': 262, 'path': 'DataTypesVariables.ipynb', 'repo_name': 'Merihun/Bash-in-Jupyter-Notebook', 'size': '2164'}