From 9f75c253794e3e72fe313ce4ac5f6a7a28fe228e Mon Sep 17 00:00:00 2001 From: Hizenberg469 Date: Tue, 25 Feb 2025 11:28:57 +0000 Subject: [PATCH] some changes --- shell/Bash-Scripting.txt | 55 ++++++++++++++++++++++++++++++++++++++-- shell/array.sh | 6 +++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/shell/Bash-Scripting.txt b/shell/Bash-Scripting.txt index c76a955..276df20 100644 --- a/shell/Bash-Scripting.txt +++ b/shell/Bash-Scripting.txt @@ -402,8 +402,8 @@ | \ | Escape | hell\.o | hell.o | | | character - | | NOT:helllo, | | | escape any of | | hell1o... | -| | the special | | | -| | character, | | | +| | the special | | (Usefule with | +| | character, | | grep) | | | ignore the | | | | | meaning of | | | | | them | | | @@ -660,3 +660,54 @@ | read name #richard read name #richard | hello Peter #hello Peter hello Peter #hello Peter | echo $name #Peter echo $name #richard + + +-> Comments: + + * Single line: + use: # + + * Multi-line: + use: : << cmt + This is + multiline Comments + in bash + cmt + +-> String in double quotes: + + In double quotes the variable value is replaced + but the special character like * (wildcard) + character is not replaced. + + Special character is replaced when used without + double quotes and without double quotes use '\' + before it to supress the behaviour of special + characters. + +-> source keyword: + + source keyword is used to run the shell script + in the same bash shell. + + Since, running a shell scripts run the script + in seperate bash shell by default, running it + with source keyword run the script in same bash + shell. + + Syntax: + source ./ + +-> := operator: + + This operator only used to initialize uninitialized + variable with a value. + + Syntax: + + hh = 4; + hh := 5; + echo hh + + Output: + 4 \ No newline at end of file diff --git a/shell/array.sh b/shell/array.sh index c53bcb5..7246474 100644 --- a/shell/array.sh +++ b/shell/array.sh @@ -1,5 +1,11 @@ #!/bin/bash +: << cmt +This is +multiline Comments +in bash +cmt + ARRAY=($(ls *.txt)) COUNT=0 echo -e "FILE NAME \t WRITEABLE"