# Can't run a script from fixit?



## Xosted (Mar 23, 2011)

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:

```
./myscript: command not found.
```

Am I missing something? is it possible to run scripts from *fixit* mode?

Thank you


----------



## SirDice (Mar 23, 2011)

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


----------



## Nukama (Mar 23, 2011)

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*.


----------



## Xosted (Mar 24, 2011)

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.


----------



## phoenix (Mar 24, 2011)

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.


----------

