Can't run a script from fixit?

Hi,

I am trying to use a script to ease the application pf modifications on clean systems. I successfully launched fixit from the FreeBSD 8.2 DVD and mounted my USB flash drive. But I can not run the script. I checked the permissions on it and execution is enable (x). Tried to copy it to the running live system but the result is the same. :\

Typing ./myscript returns:
Code:
./myscript: command not found.
:(
Am I missing something? is it possible to run scripts from fixit mode?

Thank you
 
The error is caused by the shebang line, it can't find the shell that's referred there. Confusing error message.
 
Hi,

It is possible to run scripts inside FIXIT-mode. Check if the script interpreter is inside your path. Then invoke the script manually by typing# sh script.sh or the appropriate interpreter that is specified after #! inside your myscript.
 
Well indeed, that was the issue.
Pretty confusing message for a "shell not found" error.
But thank you, you saved me a lot of time.
 
The "shell" listed in the shebang line is just a command, like any other binary on the system.

The current shell reads the script into memory, then tries to execute the command in the shebang line. If it can't find that command because it doesn't exist (#!/bin/bash for example) or because the filesystem it's on isn't mounted (#!/usr/local/bin/bash for example) then it tells you "command not found".

The error message makes perfect sense when you think about how shell scripts are executed.
 
Back
Top