LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-03-2006, 08:33 AM   #1
bungle3
LQ Newbie
 
Registered: Jan 2005
Posts: 25

Rep: Reputation: 15
running a .sh script


Am trying to run a .sh script file. Have been away from linux for a few months, been trying to remember how to run one. Have tried the old ./ but doesn't work, i know its similar but can't remember. Anyone help me out?
 
Old 10-03-2006, 08:55 AM   #2
MOS JEFF-INITELY
Member
 
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66

Rep: Reputation: 15
check permissions set to executable.
check that your $PATH has '.'
 
Old 10-03-2006, 08:56 AM   #3
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
try

# sh scriptfile.sh
# bash scriptfile.sh
 
Old 10-03-2006, 08:59 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
You can run bash using the script as an argument,
Code:
$ bash /path/to/your/script.sh
or you can turn it into a executable and run it as a command

Code:
$ cd /path/to/your
$ chmod u+x script.sh
$ ./script.sh
or add the path to it into PATH variable to run it from anywhere

Code:
$ export PATH=${PATH}:/path/to/your
$ chmod u+x /path/to/your/script.sh
$ script.sh
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a script as su automatically TongueTied Linux - Security 1 05-01-2006 09:06 AM
Running a script at a certain time... Slith(++1) Programming 3 10-04-2005 10:12 PM
Running a script spacemonk Linux - Newbie 4 07-30-2004 04:02 AM
Logrotate script is running even if my m/c is not on at 4.02 vmniza Linux - General 2 02-25-2004 06:17 AM
no result from running script cowardnewbie Programming 1 09-09-2001 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration