Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Timothy Boland
Timothy Boland
18,237 Points

Console Foundations: Shell Scripts

Console Foundations: Can the commands we are learning here be saved as a shell script and executed; like a windows batch file, or is there more to it then that?

2 Answers

James Barnett
James Barnett
39,199 Points

Timothy Boland -

You are exactly right, shell scripts & batch scripts work pretty much the same way.

Basically it's pretty straight forward:

  • write the commands in a file
  • set the file to be executable
  • execute the file using it's path

Here are some more details on Writing Your First Script And Getting It To Work

James Barnett
James Barnett
39,199 Points

Patrick Cooney -

In general it's not good form to answer a query with a bare link without any context on how it helps answer the user's question.

Timothy Boland
Timothy Boland
18,237 Points

Thanks James...

Patrick, you dont need to pay $50 a month to troll on noobs like me...there are plenty of sites out there that will let you do it for free....most of them came up in your lmgtfy link...have fun.

Patrick Cooney
Patrick Cooney
12,216 Points

Be honest. Did you google your question before posting it? That's a rhetorical question, btw. Based on your question phrasing and the availability of your answer within the first 5 search results I know that you didn't. I'm a "noob" too, as you put it. Call it trolling if you'd like, I'd prefer to think of it as helping you learn to be self reliant. If you get a job as a developer are you going to go ask the people you work with every time you have a question? Or does it make more sense to try to figure it out on your own and ask them only if you can't find the answers by yourself?

James Barnett
James Barnett
39,199 Points

Patrick Cooney - I actually agree with your point here, but that's not the culture of this forum.

I've probably been involved in more threads on this forum than anyone and quite a large number of them are solved by linking to an earlier forum topic or linking to a page that at the top of Google, that's just kinda the norm around here.

My point is that a lot of questions are google-able, and if I found the answer in the top 3 results of Google I will usually say something like this.

A quick google revealed this article on <subject>, which should get you going. If you have any questions please post them in this thread.

If the asker mentioned particular questions I might try to quickly address them and then point to the article for additional info.

Patrick Cooney
Patrick Cooney
12,216 Points

Fair enough point, but one could argue that sending people off to search on their own first should be the forum culture. Treehouse's goal is to give people the skills to become employed. Problem solving and self sufficiency are two very important skills in this field. If we just answer questions and mention that it was easily found on google I think many will gloss over the found on google part and start expecting someone to give them an answer instead of searching for it. I personally feel the forums should be more "I found this and this on google but it still doesn't make sense. Can you explain it?" Rather than "hey who wants to explain this to me?"