Hi everyone, I've been exploring Linux for a few weeks now. I have also watched a lot of Joe Collins movies on youtube. The films about scripting in particular gave me the idea that computer programs might be written in this way. Is that right?
There are lots of programming languages, and they vary in complexity, purpose, and human-readability. Very low-level languages like ASM (assembly), are basically used to directly interact and manipulate the computer hardware, by setting bits and registers, and are about as far as you can get from readability as you can get. Higher level languages are varying degrees of "plain text" and human-language-like syntax. As well, different languages might be general-purpose, and other might be very purpose-specific. So, when choosing a language, it's important to know what your goals are.Thanks for your reply. I understand, and it is not my intention at all to make computer programs. I'm just curious. Are programs always written in plain text or are they applied in other ways?
Pretty abstract question, but pretty easy answer: Yes, with one exception.Thanks for your reply. I understand, and it is not my intention at all to make computer programs. I'm just curious. Are programs always written in plain text or are they applied in other ways?
i once typed code directly onto "punched cards" for running Fortran IV circa 1975 Computer Science was a module for an O.N.D i was doingThanks for your reply. I understand, and it is not my intention at all to make computer programs. I'm just curious. Are programs always written in plain text or are they applied in other ways?
[andrew@darkstar:~]$ whoami (07-08 21:01)
andrew
[andrew@darkstar:~]$ (07-08 21:01)
You will need to learn a tiny bit of bash, most importantly the "sudo" command for updates and installation. Even though bash is a scripted programming language, you will only need to learn commands, which isn't technically programming.Thanks for your answers. Just to be clear. My intention is to learn Linux. I don't need to program. I have already followed several tutorials on youtube but what is the best learning order now.
Thank you for your message, but this is not the intention. My intention is to do as much as possible via the command line. The more so because I also have a Raspberry 3 in my network. I can approach this with putty and then of course I don't have a graphical environment.You will need to learn a tiny bit of bash, most importantly the "sudo" command for updates and installation. Even though bash is a scripted programming language, you will only need to learn commands, which isn't technically programming.
Once you have a Linux distribution installed, you will probably find using it with clicking (through the Graphical User Interface, GUI for short) really easy, or at least easy, they're not so different from everything else.
Lots of programs are installed through clicking on an install file like with Mac and Windows or through the software center (an app inside of many distros with similar names...). Knowing how to install through the command line is all you need to know with bash, no programming necessary.
Many thanks for the link to the book. I have placed it as a pdf file on my server. I spend a few hours every day learning Linux. As for Joe Collins: I learned a lot from that. His pronunciation of English is easy for me to follow. You should know that my native language is Dutch and I have not had any English lessons. The messages I post here are created using Google translate. Reading the messages generally goes well without help.Joe Collins has some really good videos, especially regarding the bash terminal, so I think you did well choosing.
Adding to what others have said, while you're new, think of the terminal, and bash, as similar to cmd (command line) in Windows. I recommend the following freely downloadable book The Linux Command Line, which does a good job explaining how to get around. https://www.linuxcommand.org/tlcl.php
Good luck on your Linux journey!
Let's start with what a script is:The films about scripting in particular gave me the idea that computer programs might be written in this way. Is that right?
What is a computer program?Script files are usually just text documents that contain instructions written in a certain scripting language. This means most scripts can be opened and edited using a basic text editor. However, when opened by the appropriate scripting engine, the commands within the script are executed. VB (Visual Basic) scripts, for example, will run when double-clicked, using Windows' built-in VB scripting support.
As you can see, they have some similarities; they're both files and run a set of instructions. So, yes, computer programs "can be written this way", but the way they're executed is different - and that explanation is beyond my pay grade, however, I do know (or think I do) a script doesn't directly interact with hardware, whereas computer programs might, i.e, graphics drivers. On Linux, you can write and execute your own scripts by using the scripting languages available by default; bash, python, awk, etc. You just need to launch a text editor, type in your code, save it with a name and the appropriate extension, for example, bash scripts have the .sh at the end of its name, i.e my_script.sh, you make this file executable, that is you tell the OS to read and run the instructions within the file, and voilà! Learning to create a few basic scripts to do one - or more - task(s) is quite handy, since you won't need to install a whole app to do it, saving some system's resources. I'm not expert by any means, by I do have a few ones to do some things; backup my dot_files to a USB drive, launch a web browser and open a URL for some webinar that is set to start at some time, check newer releases for some appimages I use ... as the old saying goes, "the sky is the limit", well, maybe not the sky, but you get the idea lolA computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer program in its human-readable form is called source code. Source code needs another computer program to execute because computers can only execute their native machine instructions. Therefore, source code may be translated to machine instructions using the language's compiler. (Machine language programs are translated using an assembler.) The resulting file is called an executable. Alternatively, source code may execute within the language's interpreter.
Scripting languages are programming languages...but programming languages are not necessarily scripting languages. All scripting languages are read by an interpreter. For example, the aliases I made:Let's start with what a script is:
From here https://techterms.com/definition/script
What is a computer program?
From here https://en.wikipedia.org/wiki/Computer_program
As you can see, they have some similarities; they're both files and run a set of instructions. So, yes, computer programs "can be written this way", but the way they're executed is different - and that explanation is beyond my pay grade, however, I do know (or think I do) a script doesn't directly interact with hardware, whereas computer programs might, i.e, graphics drivers. On Linux, you can write and execute your own scripts by using the scripting languages available by default; bash, python, awk, etc. You just need to launch a text editor, type in your code, save it with a name and the appropriate extension, for example, bash scripts have the .sh at the end of its name, i.e my_script.sh, you make this file executable, that is you tell the OS to read and run the instructions within the file, and voilà! Learning to create a few basic scripts to do one - or more - task(s) is quite handy, since you won't need to install a whole app to do it, saving some system's resources. I'm not expert by any means, by I do have a few ones to do some things; backup my dot_files to a USB drive, launch a web browser and open a URL for some webinar that is set to start at some time, check newer releases for some appimages I use ... as the old saying goes, "the sky is the limit", well, maybe not the sky, but you get the idea lol
I think the best example of a script you're probably running every day, is the ~/.bashrc file. It's a file hidden in your home directory, you can see it by launching your OS' file manager and pressing Ctrl + h keys. This file is just a shell script that is executed automatically when a user creates a new shell - like when you launch a terminal - that is a non-interactive login shell, and takes care of setting some variables and other things within that shell session. For more info read here https://tldp.org/LDP/abs/html/sample-bashrc.html
And the best example for a computer program is the OS itself, since it is just another software you install on your computer. I think you can think of scripts as "small, very basic set of instructions that perform certain tasks", and computer programs as "big, more sophisticated and complex set of instructions that can perform certain tasks".
This might be a good read: https://www.softwaretestinghelp.com/scripting-vs-programming/
alias ls='ls --color=auto -hAF'
alias lsh='ls -d .* | grep -v /'
alias lsf='ls | grep -v /'
alias lsd='ls -d */ .*/'
alias lsdh='ls -d .* | grep -v *.txt'
You can put all your aliases in the .bashrc file, too, no need for a .bash_aliases file, tho I find it better to use the latter, but it's really no necessary. Some distros don't have theWhen that code is put into a ~/.bash_aliases file, it causes the shell to interpret your commands differently than the default way it would. The shell has been programmed because the shell is instructed to read .bash_aliases if it exists.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Hmmm ... not sure on this one, but then I'm not an expert, so you're probably right. I wonder if @JasKinasis could offer some clarifying.Scripting languages are programming languages
Hmmm ... not sure on this one, but then I'm not an expert, so you're probably right. I wonder if @JasKinasis could offer some clarifying.
Actually, I did some reading, and it'd seem all scripting languages are indeed "programming languages", but not all programming languages are scripting languages. I think the problem might be defining "programming". For example, here https://www.freecodecamp.org/news/what-is-programming/ it says:i would think the distinction wouldn't be helpful to those who want to learn.
Here https://www.codingem.com/what-is-programming/ they say:Programming is the process of giving machines a set of instructions that describe how a program should be carried out.
And here https://www.codecademy.com/article/what-is-programmingProgramming means writing instructions for a computer to perform desired actions.
But here https://en.wikipedia.org/wiki/Computer_programmingProgramming is the mental process of thinking up instructions to give to a machine (like a computer).
Do note that the one from Wikipedia refers to source code and all that stuff, while the others seem to only talk about the "creative process" involve in programming. I also read another post where they say "all scripting languages are programming languages, but not all programming languages are scripting languages". I have to admit that this is way over my head; I'm no programmer, coder, hacker, nothing, nada ... I'm an ESL teacher who uses Linux. I also like linguistics, so if you want to debate on any of those topics, I'm all ears (or rather eyes and fingers lol)Computer programming is the process of performing a particular computation (or more generally, accomplishing a specific computing result), usually by designing and building an executable computer program. Programming involves tasks such as analysis, generating algorithms, profiling algorithms' accuracy and resource consumption, and the implementation of algorithms (usually in a chosen programming language, commonly referred to as coding). The source code of a program is written in one or more languages that are intelligible to programmers, rather than machine code, which is directly executed by the central processing unit. The purpose of programming is to find a sequence of instructions that will automate the performance of a task (which can be as complex as an operating system) on a computer, often for solving a given problem. Proficient programming thus usually requires expertise in several different subjects, including knowledge of the application domain, specialized algorithms, and formal logic.
Lmfao at the claim that thinking about programming is programming...a few years ago, when having some disgruntled thoughts about computers, i fantasized about making some super-virus. My fantasies never came to fruition, lol.Actually, I did some reading, and it'd seem all scripting languages are indeed "programming languages", but not all programming languages are scripting languages. I think the problem might be defining "programming". For example, here https://www.freecodecamp.org/news/what-is-programming/ it says:
Here https://www.codingem.com/what-is-programming/ they say:
And here https://www.codecademy.com/article/what-is-programming
But here https://en.wikipedia.org/wiki/Computer_programming
Do note that the one from Wikipedia refers to source code and all that stuff, while the others seem to only talk about the "creative process" involve in programming. I also read another post where they say "all scripting languages are programming languages, but not all programming languages are scripting languages". I have to admit that this is way over my head; I'm no programmer, coder, hacker, nothing, nada ... I'm an ESL teacher who uses Linux. I also like linguistics, so if you want to debate on any of those topics, I'm all ears (or rather eyes and fingers lol)
Yeah, exactly.ESL, as "english as a second language"?