Omg!!! Best teacher you are.... No one explains scripting this much clear...Great work...👏👏👏 Please continue to post linux and scripting related videos...
In case @ and * is still not cleared...here's another simple way to understand declare -a ARR=( "user1" "user2" "this is good" ) for i in ${ARR[@]} # user1 user2 this is good [will loop five times] for i in ${ARR[*]} # user1 user2 this is good [will loop five times] above , no difference when used without quotes for i in "${ARR[@]}" # "user1" "user2" "this is good" [will loop three times] for i in "${ARR[*]}" # " user1 user2 this is good" [will loop one time] difference only exists , when quotes are used with them
Hello Bro , forat of all nice video but i have a question if you can answer , If java if we want to check the map contains a specific key of not we can use the contains method But in shell script how we can find that association array contains some specific key which we are providing or not
For associative arrays in shell script , you can use ${!arr[@]} to print the keys of array. Later , you use the output of this command to check if your required key is in it or not. I had created some videos on array operations , you can check them out too to have better understabding. Thanks
@@PedagogyV but i have another doubt also , I want to read all the files and folder of current directory and also the files which are contained inside the folder of that directory , e.g I have a folder A which contains folder B and file Abc.txt and also folder B contains b.txt files and i want a program in shell script which read all the file names and folder name . I am finding some programs which can only read the folder B and abc.txt files when i am giving the path of folder A But i want also the files which are contained inside B Folder also. Can you suggest me how can i do that
@@AbhishekSharma-uy1zv use ls -R to recusive print files. If you want to list out only .txt files as extension then better to use find command as find startdir -name "*txt".
@@PedagogyV hello bro i am getting confusion in that , i want a shell script program which can read all the files and folder name recursively , i am doing reading of file name and folder name by for loop . Can you suggest me a beter way or provide me a link
you can use this : stackoverflow.com/questions/38061047/filling-a-dynamic-array-with-user-input-in-shell-scripting ofcourse , you can also get input and then assign the value to array elements
i was hella confused for array indexing nd associative arrays but now all of my doubts are cleared thankyou sirr🙏
Tq for sharing this knowledge. Great Job!
Omg!!! Best teacher you are....
No one explains scripting this much clear...Great work...👏👏👏
Please continue to post linux and scripting related videos...
Thanks a lot :)
Amazing playlist.
Nice explanation 👍
Teaching through showing differences. Plz Keep up great work!
In case @ and * is still not cleared...here's another simple way to understand
declare -a ARR=( "user1" "user2" "this is good" )
for i in ${ARR[@]} # user1 user2 this is good [will loop five times]
for i in ${ARR[*]} # user1 user2 this is good [will loop five times]
above , no difference when used without quotes
for i in "${ARR[@]}" # "user1" "user2" "this is good" [will loop three times]
for i in "${ARR[*]}" # " user1 user2 this is good" [will loop one time]
difference only exists , when quotes are used with them
Great video! I hope your channel will get noticed. I don't even know if this channel is still going. But good stuff anyway!
🔥🔥
Thank you 🙏🏻
Thank you
Hello Bro , forat of all nice video
but i have a question if you can answer ,
If java if we want to check the map contains a specific key of not we can use the contains method
But in shell script how we can find that association array contains some specific key which we are providing or not
For associative arrays in shell script , you can use ${!arr[@]} to print the keys of array. Later , you use the output of this command to check if your required key is in it or not.
I had created some videos on array operations , you can check them out too to have better understabding.
Thanks
@@PedagogyV thanks bro this works for me
@@PedagogyV but i have another doubt also , I want to read all the files and folder of current directory and also the files which are contained inside the folder of that directory , e.g I have a folder A which contains folder B and file Abc.txt and also folder B contains b.txt files and i want a program in shell script which read all the file names and folder name . I am finding some programs which can only read the folder B and abc.txt files when i am giving the path of folder A
But i want also the files which are contained inside B Folder also. Can you suggest me how can i do that
@@AbhishekSharma-uy1zv use ls -R to recusive print files.
If you want to list out only .txt files as extension then better to use find command as find startdir -name "*txt".
@@PedagogyV hello bro i am getting confusion in that , i want a shell script program which can read all the files and folder name recursively , i am doing reading of file name and folder name by for loop . Can you suggest me a beter way or provide me a link
Hi bro , Can we pass values dynamically into array in shell scripting.?? Is that possible..??
you can use this :
stackoverflow.com/questions/38061047/filling-a-dynamic-array-with-user-input-in-shell-scripting
ofcourse , you can also get input and then assign the value to array elements
how to delete or remove array elements
you can use unset