-1

I just realized that i cannot execute .sh scripts anymore on my debian. It used to work fine. All .sh files are +x chmodded and used to work fine. Suddenly, once i execute: ./test.sh system hangs. I am able to stop this via ctrl+c, but script never executes.

Steps did so far was to restart my VPS. Any ideas?

jeejee
  • 45
  • 1
  • 4
  • 11

1 Answers1

0

I am pretty sure shell scripts are still working on your machine, because if they weren't, you would not be able to complete any boot cycle.

If I suppose you are facing problems with your homemade scripts, then you should probably check your shebang line (#!/bin/sh for example) to see if anything unusual was used there.

New scripts are using a dispatcher to interpreters: 
`#!/usr/bin/env bash` #lends you some flexibility on different systems
`#!/usr/bin/bash`     #gives you explicit control on a given system of what executable is called

The difference between “#! /usr/bin/env bash” and “#! /usr/bin/bash”?

Community
  • 1
  • 1
lnrdo
  • 396
  • 1
  • 13
  • Thanks for the answer. Yes, they seem to work. It hangs on all .sh scripts of a LAMP that i use. Contents of one of them can be found here: http://pastebin.com/ntK6A0M0 – jeejee Feb 07 '15 at 12:57
  • If all are hanging on the start I would verify the line «source ./options.conf» (the content of options.conf). – lnrdo Feb 07 '15 at 13:06
  • It still hangs if I execute source ./options.conf. Options file is there. – jeejee Feb 08 '15 at 01:01
  • So, what I suspect is that the code on ./options.conf has the problem. – lnrdo Feb 10 '15 at 23:32