Page 1 of 1

How to turn code into an executable file?

Posted: Sun 31 May 2020, 16:20
by memo
hi all,

usually when there is a code that solve a problem that I need to write each time. is there a way to convert it to an write it in like a note pad and make it becomes executable by a click and also end it with a click.

thanks;

Posted: Sun 31 May 2020, 18:13
by musher0
Hi memo.

Which computer language are you using?

This is what I do with a bash script:
I write it in geany and save it.

In geany you can test a bash script by pressing F5.
It executes in a separate console window.

Edit it and retest with F5 until satisfied with the result.
Do final save from Geany. Get out of Geany.

-=> Preferred directory to save personal scripts in is
-=> /root/my-applications/bin
-=> because this directory is in the $PATH; this means that
-=> any script in it can be called from anywhere.

Then go to the directory where you saved the script and make it executable.
You can make a bash script executable by opening a console and typing

Code: Select all

chmod +x name-of-script.sh
You can do the same from the ROX filer:
locate your script, right-click on it, go down the sub-menu, click "Permissions",
and confirm.

Then you can use your script simply by clicking on it or opening a console and typing
its name.

Sorry, bash is the only language I know. With C and some other computer languages
you will have to compile your program before it becomes executable.


IHTH.

Posted: Mon 01 Jun 2020, 00:18
by enrique
1rst of all musher0 did a grate job in the explanation. Geany is your friend, learn to use it. I do not have to add on that.

I been trying to help you, you never told me you needed help with script or bash commands. Now I understand your limited response. Sorry I could had gone on the basics if you had told us. Do not worry on what we think. What is really true is that there are a bunch of guys like me that are willing to give you a hand on anything you need.

Posted: Mon 01 Jun 2020, 00:36
by mikeslr
deleted

Posted: Mon 01 Jun 2020, 09:45
by memo
@musher0

Thanks for the explanation. can I also use it to make an automated process and connect operations between apps. For instance, opening an app and take its output to be an input for another app? is bash working in any distro whether it is Ubuntu based, debian or arch? what is the best and easy way to learn it, I mean is there a course, easy to follow books, sure youtube is a great place also. let me know how did you learned it :)

Posted: Mon 01 Jun 2020, 09:46
by memo
enrique wrote: I been trying to help you, you never told me you needed help with script or bash commands. Now I understand your limited response. Sorry I could had gone on the basics if you had told us. Do not worry on what we think. What is really true is that there are a bunch of guys like me that are willing to give you a hand on anything you need.
That is very nice of you, thanks enrique :)

Posted: Mon 01 Jun 2020, 10:28
by fredx181
memo wrote:can I also use it to make an automated process and connect operations between apps. For instance, opening an app and take its output to be an input for another app?
Yes, in most cases you can, better come up with an example of what you're trying to do, to get the most accurate help.
is bash working in any distro whether it is Ubuntu based, debian or arch?
Yes.

Fred

Posted: Mon 01 Jun 2020, 10:31
by smokey01
memo, you might find this interesting.

http://smokey01.com/newsletters/2017/Ap ... 17.html#10

Posted: Mon 01 Jun 2020, 14:38
by memo
Thanks every one, The link of smokey01 has many useful information that is easy to follow.

meanwhile, here is a nice song to brighten your day!

https://www.youtube.com/watch?v=LjBLiMm-0lc

have a nice day evey everyone :)

Posted: Tue 02 Jun 2020, 07:22
by enrique
memo I have work on may project that I had no Idea I could do. I always went to Youtube search for a tutorial series and downloaded whole series. I then move the movies to my Tablet and when I did went to bed I watch the videos until sleep. Yes instead of books.

Regards Linux.
There are many interpreter from sh, ash, bash, etc, many many. But on Linux sh is more less the original. But Most now use bash. I say this because at one time or another you will find that a command will need to be modify.

I see this in 3 steps.
Learn Linux Basic => To me this mean leaning BASH.
Learn to script => This is just a few commands written in to a file to produce a simpler solution.
Improve Scripting => Here you try to find your self to make the task easier. Use Geany, Learn to use GTKdialogs, etc.

But see that all start by learning BASH. Please do and use Geany it is your friend. Now MOST Puppians look for a Windowfyied Linux. And they HATE the techky stuff and the terminal. Be smart and learn the basics.

Here a youtube link to start:

Code: Select all

https://www.youtube.com/playlist?list=PLTXMX1FE5Hj5ZJDt_WMbioFpdWO5SGy8r

Posted: Tue 02 Jun 2020, 09:18
by memo
enrique wrote:memo I have work on may project that I had no Idea I could do. I always went to Youtube search for a tutorial series and downloaded whole series. I then move the movies to my Tablet and when I did went to bed I watch the videos until sleep. Yes instead of books.

Regards Linux.
There are many interpreter from sh, ash, bash, etc, many many. But on Linux sh is more less the original. But Most now use bash. I say this because at one time or another you will find that a command will need to be modify.

I see this in 3 steps.
Learn Linux Basic => To me this mean leaning BASH.
Learn to script => This is just a few commands written in to a file to produce a simpler solution.
Improve Scripting => Here you try to find your self to make the task easier. Use Geany, Learn to use GTKdialogs, etc.

But see that all start by learning BASH. Please do and use Geany it is your friend. Now MOST Puppians look for a Windowfyied Linux. And they HATE the techky stuff and the terminal. Be smart and learn the basics.

Here a youtube link to start:

Code: Select all

https://www.youtube.com/playlist?list=PLTXMX1FE5Hj5ZJDt_WMbioFpdWO5SGy8r
great stuff Enrique, thanks a lot I am watching the first video right now :)