Find the answer to your Linux question:
Results 1 to 5 of 5
(title) thanks in advance...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    35

    is there a way to run a script by writing ./script instead of ./script.sh?


    (title)

    thanks in advance

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Just rename the script from "script.sh" to "script". Your script will need to be made executable and at the top you should have a line (or lines) that stipulate which shell should be used to run the script e.g.
    Code:
    #!/usr/bin/env bash
    or
    Code:
    #!/usr/bin/bash

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    35
    yea works fine now...

    thanks m8

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    341
    And if you put it in your /user-name/bin/ folder you don't need to type the "./" just "script".
    Pete

  6. #5
    Just Joined!
    Join Date
    Dec 2006
    Posts
    85
    also you can set kde (if you have it) to run the script when you run a certain file, for instance: if i have a script which runs mplayer i can run that script from kde by using <path to script>/thescript.sh %U i like that one a lot (i love using custom scripts for things like that)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •