0

I've made a new command/alias like hello in /home/****/bin/hello

when I execute as root user:

$ hello

it's output like:

Hello, the program executed by terminal command. 

but when I execute with fish shell

$ hello

output

Failed to execute process '/home/***/bin/hello'. Reason:
exec: Exec format error
The file '/home/***/bin/hello' is marked as an executable but could not be run by the operating system.

I've searched in google but I'm not success. No file or directory exist as ~/.config/fish/functions

Please help me as I'm not expert in the Linux world.

Anowar Hossain
  • 583
  • 4
  • 17
  • Solution: `$ alias hello="execute the hello program"` then `$ function hello . /home/anowar/bin/hello end` then `$ funcsave hello` – Anowar Hossain Aug 05 '16 at 18:08
  • Your solution is much more complicated than necessary. The issue is that your script (which is not an alias) is lacking a shebang line, so the kernel (which fish passes it to) does not know how to execute it. Either add `#!/bin/sh` (if you wrote an sh-compatible script) or execute it with `sh /path/to/hello`. – faho Aug 26 '16 at 17:44

0 Answers0