Need feedback: Would you like runable bash shell examples?

Hey FOSSome people,

Need some feedback on a ‘feature’ I am thinking to add.

How about the ability to run some bash shell examples directly on the website?

Like the example on this page here: How to Use Variables in Bash Shell Scripts

If you click the run button, it will execute the bash command/script. You may even edit the given code and change it.

It’s all sandboxed and not all Linux commands and bash scripts can be run this way.

Do you think it will be a good thing to add to some of the tutorials? Specially the bash scripting series and terminal series?

2 Likes

Okay… that could be another tropic we could work on… bash script example to accomplish xyz task. Thanks for the idea.

This thing here is more for existing tutorials that may have scenarios where you can run an example directly on the website, instead of doing it in your terminal.

1 Like

Personally, I don’t need it and I don’t think it adds remarkable value.
But as long as not every posted bash snippet will be automatically rendered this way, might be OK.

4 Likes

Thanks for the feedback @abu

1 Like

Hi @abhishek I think that would be a great addition. For me, having a sandboxed environment while testing those I would like to try, is a safe way to learn. Would we get error messages for wrong syntax, etc.? Help from the community would be much simpler if it is right here on ItsFOSS.

Being able to practice what I learn in those series is definitely a +1 for me!

Thanks,
Sheila

3 Likes

Sadly i have no use, but will look on with interest

3 Likes

Are you talking about dynamic documents?.. ie documents which incorporate code and can run it dynamically when viewed.

In R it is called ‘Sweave’ or ‘R Markdown’. I dont know what exists outside of R?

I think a dynamic document would run on the user’s machine, not on your site?

2 Likes

@abhishek :

Hi Abhishek, :waving_hand:

In theory this looks like a valuable addition to the forum.

Yet I´m still a bit worried about the sandboxing feature. :thinking:
Where does the sandbox reside, I wonder.
Is it running on the itsfoss server?

We certainly won´t be willing to open a door for possibly malicious code to be executed on our local machines, right?

If in doubt, there´s still the option not to click the “run” button, I suppose.

Could you tell us a bit more about the sandboxing mechanism :red_question_mark:
How exactly does it work and is it safe enough for us forum members?

Thanks a lot.
Many greetings from Rosika :slightly_smiling_face:

3 Likes

Thanks for your answer @Rosika

I am considering using https://codapi.org/

And it can only run a few Linux commands, in a sandbox, on its own server. It won’t eb running on the same server as this forum or the website.

3 Likes

Sort of… Like there is bash tutorial that teaches the basic concepts. If simple examples can be followed directly on the website, it may help some learner as they won;t have to open their terminal and they can practice along with reading the chapters.

3 Likes

Hi Abhishek, :waving_hand:

thanks for your reply.

I just took a look at it and even tried it out:

I never knew that such an interactive site existed. Good to know. :blush:

I guess that´s the main part as far as security is concerned.

virustotal also lists the site as trustworthy:

No security vendors flagged this URL as malicious
0/97

All this looks promising indeed.

Thanks again and many greetings fom Rosika :slightly_smiling_face:

4 Likes

Same here… but interesting concept…

2 Likes

I studied Kotlin on Hyperskill’s website for a while, and they provided a page where I could write code to test what I believed would provide the expected answer/solution to multiple choice questions at the end of the chapters/sections I learned. I found that site to be very helpful. Of course, there were also questions that asked me to write a program based on specifically provided specifications too.

I think that having bash scripts that I can run on the website could be useful to users who are learning to write scripts, especially if you ensure that what ‘students’ see is properly formatted. Then tutorial students would see properly formatted code as well as being able to run/edit the scripts to see how code changes effects the output/result. At present, when I go through a tutorial, I put Firefox on one side of my screen, and a terminal window on the other so I can run the code I see in the tutorial, unless it looks like it would persistently change my system configuration. I say Go for it!

Ernie

3 Likes