General TC > Programming & Scripting - Unofficial
How to run the scripts
meo:
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?
Kingdomcome:
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: ---chmod +x name-of-it.sh
--- End code ---
You can then run the script from the directory it was saved with the command
--- Code: ---./name-of-it.sh
--- End code ---
The ./ 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 :)
meo:
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
mikshaw:
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.
meo:
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
Navigation
[0] Message Index
[#] Next page
Go to full version