How to turn code into an executable file?

Using applications, configuring, problems
Post Reply
Message
Author
memo
Posts: 268
Joined: Thu 28 Jun 2018, 10:38

How to turn code into an executable file?

#1 Post 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;
Xanialpup 7.5 32 bit

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#3 Post 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.

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#4 Post by mikeslr »

deleted

memo
Posts: 268
Joined: Thu 28 Jun 2018, 10:38

#5 Post 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 :)
Xanialpup 7.5 32 bit

memo
Posts: 268
Joined: Thu 28 Jun 2018, 10:38

#6 Post 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 :)
Xanialpup 7.5 32 bit

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#7 Post 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

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#8 Post by smokey01 »

memo, you might find this interesting.

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

memo
Posts: 268
Joined: Thu 28 Jun 2018, 10:38

#9 Post 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 :)
Xanialpup 7.5 32 bit

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#10 Post 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

memo
Posts: 268
Joined: Thu 28 Jun 2018, 10:38

#11 Post 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 :)
Xanialpup 7.5 32 bit

Post Reply