Scripting Classroomnotes 01/Dec/2022

Getting the Job Done by Systems

  • Steps to be followed in our recipes is executed by cpu
  • To remember any value we deal with RAM
  • Any Script/Program which we will be executing will be run by the OS as a process. Each process will have pid, cpu shares and memory
  • When we ask os to run any program it run step by step.
    • step in python is a new line almost the same for bash.
  • When program needs to remember or access any values it refers RAM.
  • Every operating system has a concept of Environment variables. These are the values which are shared across all the processes in the single system.
  • Memory used by one process or the values in the memory of one process cannot be accessed by other processes.

Allocating Memory in Programs/Scripts

  • To allocate memory we need to specify size we need and it returns address which is generally a hexadecimal number
  • We cannot use hexadecimals to access memory, so use a mathematical concept (x = 5). Here lets assume x is alias to your memory location
index = 5
pi = 3.14
  • For specifying size in programming, the easier way is to categorize size by types of Data
    • integer
    • decimal
    • character
    • string
  • Declaring Variables
    • Powershell
    • Bash/Shell
    • Python
  • Ensure you install python and git bash

Activity

  1. Lets create a file which works on bash/shell to remember a value and print it
  2. Repeat the same in powershell as well as python
  3. Refer Here for the scripts in 3 different languages.
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio
Exit mobile version
%%footer%%