scripts guideline for noob

maybe someone can say a good guideline for newbie so can run fine with the opensuse bash? i try to start some learning guideline tutorial or some thing, but all time need some command or grammar because it’s for another linux distro.
i know my english is baaaadddd…but i want learning guide in english.

bash is bash. Regardless of the distribution.

And it so much the same as e.g. sh (Bourne shell) and the POSIX shell, that you can without problems use a book about one of those to learn things.

really? i try to does this simple learning for expect
https://likegeeks.com/expect-command/
but when run “send” ,"spawn , and “interact” are loss, i try to install through yast or zypper but there is no way for locate the package or packages needed.
Some time ago i start another one guide, and can’t continue too because similar issue. can you tell me what i need install or some think, for have all posible command needed for some guide? and if you know some concrete guideline good for newbie, i’ve so thanks to you.

You mean that in fact your question is about expect and not about bash at all?

Then your thread title, nor your first post cover this :frowning:

expect does not seem to be installed in a standard installation, but you (at least I) can find it with YaST > Software Management. Type expect in the Search field. Select for install and install it.
Or

zypper in expect

seem to don’t understand my last post, the expect if yet in my console, and this was only a simple example. the between qoutation marks commands are no possible located for me.
the thread title it’s just i looking for. I search for all ways i know for that, but can’t locate some one specific for opensuse, and i have some issues with the others i try to do.
Just only for this reason i start this thread. But appear no work fine, i’m so sorry to bothering you.
If there is some user understand my problem and know how to help me, i would be so grateful.
thanks to try help me. :).

I am very, very sorry, but I hardly understand what you are writing. Do you use Google translate or the like?

I will try the opposite way, I write in google translate in Spanish, in case the grammar and the words are more understandable.
The example about “expect” that if it exists as a command in my console, led me to have to use the others, which are the ones that are not, nor can I locate.
Just like with previous attempts, some command does not exist in my console, and I can not locate it to install it in my system, hence I look for some tutorial from the beginning, start with “hello world” and can do until the end.
What I found to be the ones I tried to do for now, is that the command interpreter “bash” is not the same for all linux distributions, since by advancing in the courses, I always find a command that is not In my bash.
Also could install the same distribution used by the author of the tutoring, to avoid these problems during the course, but this would not be a good idea, since at the end what I want is to do my own escripts for my opensuse (built in susestudio) I have updated the bash and added both devel and what I thought could be useful, but neither are “send” or “spawn” although I have “spawn_console” but I do not know if it is the same … and also is not " Interact ", mentioned and used for the simple scripts using expect to wait for the response of a command and condition the output of the following, which I found very interesting.
I feel it to be so long, and I hope it will serve to make it better understood. And again thanks for trying to help me.

You have confusing ideas about bash. that is just a shell, so called because it is a wrapping shell around the Kernel to give an interface to a user to let the kernel do things. One of those things is starting programs. Of course only programs that exist on your system (and that can be found on the system by the shell using certain rules) can ever be executed.

Thus when a program is not there, this has nothing to do with bash. It is simply a program you want to have on your system. Thus posting this as “scripts guideline for noob” instead of e.g. “can not find program xxxx on my system nor on installation media” will not help you in getting good answers.

Also not finding a program does not have much to do with Programming/Scripting. I suggest you start one or more new threads in the Applications section where you ask for those programs you need, but can not find.

Your clarification is interesting and has clarified some things. I started that course (the “expert”) from the beginning, and as it seems that the writer responds, I can consult my doubts.
Do not obsact if someone could recommend a course for “scripts” that works well in opensuse, without having to add to the study to look for extra programs, will be well received.
Thank you so much for everything.

If you’re asking about BASH in general, then there are numerous and even a a semi-official BASH reference
https://www.gnu.org/software/bash/manual/bashref.html

It does help to know if you’re trying to do something specific.
So, for instance “expect” is a commonly used engine to automatically answer an interactive script application.

But,
If you’d like an alternative to having to install the expect app and learning how it works,
Along with a number of other useful scripts I’ve come across, I described how to create a “Here Document” to accomplish the same functionality (automatically answer an interactive script)

Using a Here Document to auto answer a script, example I use is the setting up the security for a brand new MySQL/Mariadb
Advantage of creating a Here Document is that you can use it anywhere and it “just works” without having to install apps like “expect.”
https://en.opensuse.org/User:Tsu2/MySQL_and_Mariadb

A list of the useful scripts I’ve come across
https://en.opensuse.org/User:Tsu2/Scripts_and_Scriplets

TSU

Again, please be carefull in the wording you are using. “scripting” is far to general if I understand you. There are many scripting languages (I think to most well known early one is Basic). Several Unix/Linux shells (Bourne shell, -shell, ksh, …), Python, Ruby,…

When you want to find tutorials about bash, part of the work is done by tsu2 in the post above. But searching with Google for “bash tutorial” brings many result and you better look for yourself, because I am not going to copy that long list of results in this post.

On 2017-03-01, hcvv <hcvv@no-mx.forums.microfocus.com> wrote:
> Again, please be carefull in the wording you are using. “scripting” is
> far to general if I understand you. There are many scripting languages
> (I think to most well known early one is Basic).

Please correct me if I’m wrong but wasn’t the original BASIC (from Dartmouth) a compiled language rather than
script-interpreted? Apologies for pedantry and minor deviation but I’m well aware of Henk’s penchant for accuracy!

I won’t correct you because I do not know. I know that Basic was well known and much used as a scripting language in those days. For people used to compiled and assembled languages an interpreted language was quite an innovative idea.

It is certainly the case that in some Basic implementations, you could compile your finished program (after testing through the interpreter) to get faster executables.

But in this thread, it only serves to make the OP clear that bash is not the only and not the first scripting language and that thus saying “help me with scripting” is a bit vague.

On 2017-03-03, hcvv <hcvv@no-mx.forums.microfocus.com> wrote:
> But in this thread, it only serves to make the OP clear that bash is not
> the only and not the first scripting language and that thus saying “help
> me with scripting” is a bit vague.

I agree. Actually reading the OP again, I can see that it could even be interpreted as referring to the `ancient scripts
of Zen’ maintained by openSUSE!

rotfl! Scripts or scriptures?

You can find definitions and descriptions of BASH (Bourne Again SHell) everywhere.
In general (my definition), BASH is a scripting environment which means it’s more than simply a scripting language, it’a also the console which supports BASH commands.

Without doing any investigation, I’d assume that like 99% of all script environments today, BASH is an interpreted JIT (Just in Time) language. This means that your application code is passed in a raw form, and is fed serially to an “interpreter” engine that converts your code on the fly to lower level instructions for execution. This is very different than compiled code like C, Java, dotNET, etc where the Developer writes code which he himself has to compile before distributing. The two different code execution architectures are important because generally it will mean that interpreted code can be created and run quickly and simply, but is somewhat limited in power and scalability. Compiled code doesn’t need to be compiled/interpreted on the fly and so also likely is more efficient and capable.

There are some very recent exceptions, Javascript now can run in a Google V8 engine with the same benefits of compiled code, and Python has some very recent similar engines as well. Some applications like Visual Studio can compile any supported development language into the Common Language Runtime.

Basic is another scripting language that has nothing to do with BASH, and like most scripting languages is almost never to be confused with a compiled language.

HTH,
TSU