HauntedPi,
Consider starting a little project using Bash scripting language that you have no idea how to proceed with. Break it down into little tasks and, by asking simple questions of Google, search the web for suggestions on how to do it.
I needed to organise all my digital pbotos, all in separate directories under a parent directory, and did so by wrapping a load of HTML around each file name and writing that to a file. Rather than writing the HTML directly I cobbled together a script which searched a directory for JPEG image file names. Then it was a matter of wrapping the necessary image file in the required HTML wrapper and appending it to a file with the previous stuff. By detecting directory names the script could call itself while also tracking where things were going and writing this in the HTML file. I also leant a lot about HTML.
Agreed, rather an off the wall solution but I got to explore the far corners of scripting as I tried to solve some of the daft situations I found myself in.
Perhaps the most critical two things is:
1: The first line of the script file : Bash scripts start with a 'shebang' ( #! ) followed by the path to the bash interpreter ( /bin/bash or /usr/bin/env bash ).
2: Understanding "chmod" enough to make your new script executable.
Followed by understanding how value or string can be assigned to a variable and how that new variable can be read by sticking a dollar symbol on the front of it. There are loads of pit-falls triggered by including spaces or indeed missing spaces to say nothing about how square and curved brackets opperate.
Maybe get a few pages/topics into a course then just have a go.
After this its just a list of command lines in a file that can be invoked as one command line whenever you need it.
Being a bit dyslexic I've always struggled following someone else's ideas on how to do something preferring to wing it as I go cross checking/referencing as I need.
Consider starting a little project using Bash scripting language that you have no idea how to proceed with. Break it down into little tasks and, by asking simple questions of Google, search the web for suggestions on how to do it.
I needed to organise all my digital pbotos, all in separate directories under a parent directory, and did so by wrapping a load of HTML around each file name and writing that to a file. Rather than writing the HTML directly I cobbled together a script which searched a directory for JPEG image file names. Then it was a matter of wrapping the necessary image file in the required HTML wrapper and appending it to a file with the previous stuff. By detecting directory names the script could call itself while also tracking where things were going and writing this in the HTML file. I also leant a lot about HTML.
Agreed, rather an off the wall solution but I got to explore the far corners of scripting as I tried to solve some of the daft situations I found myself in.
Perhaps the most critical two things is:
1: The first line of the script file : Bash scripts start with a 'shebang' ( #! ) followed by the path to the bash interpreter ( /bin/bash or /usr/bin/env bash ).
2: Understanding "chmod" enough to make your new script executable.
Followed by understanding how value or string can be assigned to a variable and how that new variable can be read by sticking a dollar symbol on the front of it. There are loads of pit-falls triggered by including spaces or indeed missing spaces to say nothing about how square and curved brackets opperate.
Maybe get a few pages/topics into a course then just have a go.
After this its just a list of command lines in a file that can be invoked as one command line whenever you need it.
Being a bit dyslexic I've always struggled following someone else's ideas on how to do something preferring to wing it as I go cross checking/referencing as I need.
Statistics: Posted by RaspISteve — Sat Mar 16, 2024 4:37 pm