0

Why when I run the command

gnome-terminal -e "ssh -t sv \"cd ~/tmp/perl_libs/bin; bash /usr/bin/tail -f ~/open; echo 'YES'; exec $SHELL\""`

I got

/usr/bin/tail: cannot execute binary file
4
  • The tail -f is unlikely to exit, so your YES will never get printed and your target $SHELL won't be run. Perhaps you intend just to show the last few lines on the file, in which case omit the -f.
    – roaima
    Mar 1, 2016 at 12:22
  • I know. The bash -i command prevents that. So I may CTRL+C to exit from tail -f. The question were 'why I can not run command with bash' and I get sharp answer Mar 1, 2016 at 12:27
  • I see no sharp answers. You have one answer that explains how to fix the problem you're seeing. I was concerned about your tail -f, and warned you of the issue. You're happy with using Ctrl/C to end the tail -f process, so that's fine.
    – roaima
    Mar 1, 2016 at 12:30
  • I get this error because tail is Not a bash script Mar 1, 2016 at 12:43

1 Answer 1

6

All you need to is remove the bash in front of the tail.

As shown in

file /usr/bin/tail
/usr/bin/tail: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped

tail is a ELF file. Not a bash script.

1
  • Or, maybe, add -c bash option? Nov 20, 2018 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.