Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
    
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 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 – Eugen Konkov Mar 1 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 at 12:30
    
I get this error because tail is Not a bash script – Eugen Konkov Mar 1 at 12:43

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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