LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-22-2015, 02:31 AM   #1
rasanpreet
LQ Newbie
 
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
Basic Scripting query


I am new to bash scripting. i had tested a basic script eg. script.sh and it get executed. But it also gives an output "./script.sh: line 1: #!/bin/bash: No such file or directory"

How to resolve this. Plz help
 
Old 04-22-2015, 03:20 AM   #2
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
apparently bash is not installed in /bin
do a 'which bash'
and update accordingly

For example:
which bash
gives the answer
/usr/bin/bash

then the shebang (1st line) would be:
#!/usr/bin/bash

Of course, it's also possible bash is not installed, in which case you will get that as answer from which; it would be interesting to see what shells are available.

The following command might help on that: echo $SHELL
It should give you an indication on where your shell is located.
 
1 members found this post helpful.
  


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
Basic SAN LUN query pinga123 Linux - Newbie 2 12-06-2011 08:32 PM
Basic Query about output. pinga123 Linux - Newbie 1 10-29-2009 11:54 PM
Scripting query.. crash_override_me Programming 8 07-23-2007 04:20 AM
SSL : Basic Query vikasumit Linux - General 1 05-08-2006 01:30 AM
Scripting Query sc_3007 Linux - General 4 12-01-2005 02:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:32 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