Advertisement
Guest User

less executes a script instead of displays it

a guest
Sep 13th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. ### less executes a script instead of displays it ###
  2.  
  3. support@server:~$ grep ^Ubuntu /etc/motd
  4. Ubuntu 10.04.2 LTS
  5.  
  6. support@server:~$ which less
  7. /usr/bin/less
  8.  
  9. support@server:~$ ls -l /usr/bin/less
  10. lrwxrwxrwx 1 root root 9 2011-06-30 10:38 /usr/bin/less -> /bin/less
  11.  
  12. support@server:~$ file /bin/less
  13. /bin/less: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
  14.  
  15. support@server:~$ env | grep -i less
  16. LESS= -R
  17. LESSOPEN=| %s
  18.  
  19. support@server:~$ ls -l /usr/local/bin/test.sh
  20. -rwxr-xr-x 1 root root 23 2011-09-13 09:24 /usr/local/bin/test.sh
  21.  
  22. support@server:~$ file /usr/local/bin/test.sh
  23. /usr/local/bin/test.sh: Bourne-Again shell script text executable
  24.  
  25. support@server:~$ cat /usr/local/bin/test.sh
  26. #!/bin/bash
  27.  
  28. echo TEST
  29.  
  30. support@server:~$ less /usr/local/bin/test.sh
  31. # this gives...
  32.  
  33. ====================================
  34. TEST
  35. /usr/local/bin/test.sh (END)
  36. ====================================
  37.  
  38. # It runs the script! Fatal warning! :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement