Jump to content


Photo
- - - - -

Shell Script Quick Question.


  • Please log in to reply
4 replies to this topic

#1 Ragnarok30

Ragnarok30

    mad 1337

  • Members
  • 131 posts

Posted 25 March 2009 - 11:07 PM

I have a little 2 line script. I am running Ubuntu. I want to just double click it and run it (like a batch file).

When I do double click it, it is opened in the text editor? Can someone remedy this?

#2 mirrorshades

mirrorshades

    aviatorglasses

  • Agents of the Revolution
  • 951 posts
  • Gender:Male

Posted 25 March 2009 - 11:18 PM

What's the filename?

Also, you could post the contents of the script if you like.

#3 Spyril

Spyril

    Hakker addict

  • Members
  • 588 posts
  • Location:North Dakota

Posted 25 March 2009 - 11:19 PM

chmod a+rwx /path/to/file


#4 Ohm

Ohm

    I could have written a book with all of these posts

  • Members
  • 3,209 posts
  • Gender:Male
  • Location:Maine, USA

Posted 25 March 2009 - 11:26 PM

chmod a+rwx /path/to/file


If you're going to use chmod, at least use it properly. It's good that you're no longer using octal mode. It's bad that you're repeating all the same mistakes. Never set all permission bits unless that's what you really want to do.

chmod +x /path/to/file

How hard is that?

@Ragnarok30: I assume you're using Gnome. Gnome will ask you what to do with any file with execute permissions. Just click Run and it'll run go.

#5 Ragnarok30

Ragnarok30

    mad 1337

  • Members
  • 131 posts

Posted 26 March 2009 - 08:19 AM

Oh wow. I should have known this. You guys are really remarkable sometimes. I have to goto work now, I'll have to try this in the evening.

This is what I'm trying to pull off if you guys are interested. Shut down your PC via SMS




BinRev is hosted by the great people at Lunarpages!