WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to run the scripts  (Read 5083 times)

Offline meo

  • Hero Member
  • *****
  • Posts: 651
How to run the scripts
« on: October 07, 2009, 05:29:21 PM »
Hi all!

There are some pretty nice scripts in this "unofficial" section. I have tried to run some of them but with no success. So I just have a plain and somewhat stupid question: How can I run these scripts? I'm referring to skype, realplayer and so forth. I have saved the scripts using beaver, putting them in /home/tc from where I've tried to run them. So far I've just gotten error messages in the terminal when I've tried to run scripts. So, please can someone help me to get this going. I'd be very grateful for any help to work this out.

Have fun extending the possibilities of tinycore,
meo

EDIT  I have saved the scripts like: the-name-of-it.sh which probably is wrong?
« Last Edit: October 07, 2009, 05:32:45 PM by meo »
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: How to run the scripts
« Reply #1 on: October 07, 2009, 09:44:20 PM »
Using the name name-of-it.sh is perfectly fine, and in some situations useful to help identify it as a shell script, although the .sh suffix is not required.  Using beaver to save the script can sometimes cause problems if you miss a line (especially the first line) when you copy from the website.  Most of the scripts in this section have also been uploaded as attachments that you can see at the bottom of the post which contains the script. You must be logged in to the forum to see attachments though.  The key step you are probably missing is making the script executable after saving (or downloading), you do that by running the command
Code: [Select]
chmod +x name-of-it.shYou can then run the script from the directory it was saved with the command
Code: [Select]
./name-of-it.shThe ./ in front of the script name is important if you are saving the script to a location that is not in your $PATH.  Hope this helps :)

Offline meo

  • Hero Member
  • *****
  • Posts: 651
Re: How to run the scripts
« Reply #2 on: October 08, 2009, 04:04:27 AM »
Thanks Kingdomcome!

Yes it was the to issue the command to make the script executable that I had forgotten. Thanks again for making me get on the right track.

Have fun with tinycore and it's extensions,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: How to run the scripts
« Reply #3 on: October 08, 2009, 09:02:34 AM »
You can also run a script indirectly, in the case where either your current user doesn't have permission to change the file, and/or there is no interpreter listed at the top of the file.  To do this you run the interpreter and use the script as an argument to the interpreter:
sh name-of-it.sh

I very seldom do it, but I've seen a few people who apparently prefer this method over making files executable.

Offline meo

  • Hero Member
  • *****
  • Posts: 651
Re: How to run the scripts
« Reply #4 on: October 08, 2009, 09:59:19 AM »
Hi mikshaw!

Thanks for that info! It may be very handy now when I've become a "script freak". Before now I was just a "distro junkie" (trying out many linux distros almost before they are released).

Have fun helping out us who aren't "bash-ers" yet,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: How to run the scripts
« Reply #5 on: October 08, 2009, 02:43:47 PM »
Just an addendum:

Scripts stored in /home/tc/.local/bin can be run without the ./ prefix