Why is this vim plugin not getting loaded? - vim

I am using pathogen to build a plugin bundle to manage my blog. For starters I wanted to factor out some commands I defined directly in my vimrc and move them to a plugin. Here's how I set up the bundle:
call pathogen#infect('/home/frew/code/blog/etc/vim-bundle/{}')
Here is a brief snippet of the beginning of the plugin:
echom "loaded hugo plugin"
if exists('g:loaded_hugo') || &cp || v:version < 700
finish
endif
let g:loaded_hugo = 1
function! Tagged(tag)
exe 'args `bin/tag-files ' . a:tag . '`'
endfunction
command! -nargs=1 Tagged call Tagged('<args>')
And here is the directory structure of the bundle:
/home/frew/code/blog/etc/vim-bundle/
└── hugo
└── plugin
└── hugo.vim
2 directories, 1 file
The echom is never getting run, and furthermore I straced a gvim and here is what I found matching /home/frew/code/blog/etc/vim-bundle/: (I filtered out the duplicates with sort -u)
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftdetect/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/html/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/markdown/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/markdown/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC <unfinished ...>
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC <unfinished ...>
open("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/vim/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/markdown/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vim/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vim/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC <unfinished ...>
open("/home/frew/code/blog/etc/vim-bundle/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 18
stat("/home/frew/code/blog/etc/vim-bundle/hugo/after", 0x7fffd759c6d0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/ctrlp/utils.vim", 0x7fffd759a620) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/editorconfig.vim", 0x7fffd759c650) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/gitgutter/async.vim", 0x7fffd759d2f0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/gitgutter/debug.vim", <unfinished ...>
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/gitgutter/diff.vim", 0x7fffd759e6d0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/gitgutter/sign.vim", 0x7fffd75a0040) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/autoload/htmlcomplete.vim", 0x7fffd759c4c0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/filetype.vim", 0x7fffd759f830) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftoff.vim", 0x7fffd759f830) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/html.vim", 0x7fffd759cf40) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/html.vim", 0x7fffd759d050) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/html.vim", 0x7fffd759d270) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/markdown.vim", 0x7fffd759da70) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/markdown.vim", 0x7fffd759dda0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/markdown.vim", <unfinished ...>
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/vim.vim", 0x7fffd759e6e0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/vim.vim", 0x7fffd759e830) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/ftplugin/vim.vim", <unfinished ...>
stat("/home/frew/code/blog/etc/vim-bundle/hugo/indent/markdown.vim", 0x7fffd759da70) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/indent/markdown.vim", 0x7fffd759db80) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/indent/markdown.vim", 0x7fffd759dda0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/indent/vim.vim", 0x7fffd759e830) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/indent/vim.vim", <unfinished ...>
stat("/home/frew/code/blog/etc/vim-bundle/hugo/scripts.vim", 0x7fffd75a0060) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/css.vim", 0x7fffd759ae20) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/css.vim", 0x7fffd759af30) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/css.vim", 0x7fffd759b150) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/html.vim", 0x7fffd759b9e0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/html.vim", 0x7fffd759baf0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/html.vim", 0x7fffd759bd10) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/javascript.vim", 0x7fffd759ae20) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/javascript.vim", 0x7fffd759af30) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/javascript.vim", 0x7fffd759b150) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/markdown.vim", 0x7fffd759c510) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/markdown.vim", 0x7fffd759c620) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/markdown.vim", 0x7fffd759c840) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/pod.vim", 0x7fffd759b230) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/pod.vim", 0x7fffd759b380) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vb.vim", 0x7fffd759ae20) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vb.vim", 0x7fffd759af30) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vb.vim", 0x7fffd759b150) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vim.vim", 0x7fffd759d2d0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/syntax/vim.vim", <unfinished ...>
stat("/home/frew/code/blog/etc/vim-bundle/hugo/vimfiles", 0x7fffd759cce0) = -1 ENOENT (No such file or directory)
stat("/home/frew/code/blog/etc/vim-bundle/hugo/vimfiles/after", 0x7fffd759c750) = -1 ENOENT (No such file or directory)
Clearly it found the hugo plugin directory, it just never even tried looking in the related plugin subdirectory.
What am I missing here?
Update: Here's the current value of &rtp:
/home/frew/code/blog/etc/vim-bundle/hugo,/home/frew/.vim,/home/frew/.vim/bundle-lua/neocomplete,/home/frew/.vim/
bundle-python/editorconfig,/home/frew/.vim/bundle-python/ultisnips,/home/frew/.vim/bundle/FastFold,/home/frew/.v
im/bundle/IndentAnything,/home/frew/.vim/bundle/airline,/home/frew/.vim/bundle/better-whitespace,/home/frew/.vim
/bundle/colors-solarized,/home/frew/.vim/bundle/commentary,/home/frew/.vim/bundle/csv,/home/frew/.vim/bundle/ctr
lp,/home/frew/.vim/bundle/denite,/home/frew/.vim/bundle/eunuch,/home/frew/.vim/bundle/exchange,/home/frew/.vim/b
undle/fugitive,/home/frew/.vim/bundle/fugitive-gitlab,/home/frew/.vim/bundle/gitgutter,/home/frew/.vim/bundle/go
,/home/frew/.vim/bundle/goyo,/home/frew/.vim/bundle/inkpot,/home/frew/.vim/bundle/l9,/home/frew/.vim/bundle/last
place,/home/frew/.vim/bundle/lost,/home/frew/.vim/bundle/matchit,/home/frew/.vim/bundle/matchmaker,/home/frew/.v
im/bundle/obsession,/home/frew/.vim/bundle/pathogen,/home/frew/.vim/bundle/perl,/home/frew/.vim/bundle/projectio
nist,/home/frew/.vim/bundle/python,/home/frew/.vim/bundle/quick-scope,/home/frew/.vim/bundle/repeat,/home/frew/.
vim/bundle/sleuth,/home/frew/.vim/bundle/splitjoin,/home/frew/.vim/bundle/surround,/home/frew/.vim/bundle/tabula
r,/home/frew/.vim/bundle/terminus,/home/frew/.vim/bundle/textobj-between,/home/frew/.vim/bundle/textobj-entire,/
home/frew/.vim/bundle/textobj-underscore,/home/frew/.vim/bundle/textobj-user,/home/frew/.vim/bundle/unimpaired,/
home/frew/.vim/bundle/vinegar,/home/frew/.vim/bundle/visual-star-search,/home/frew/.vim/bundle/wipeout,/var/lib/
vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,
/home/frew/.vim/bundle/tabular/after,/home/frew/.vim/bundle-python/ultisnips/after,/home/frew/.vim/after

Tim Pope answered this question on github. Plugins get loaded before sessions, so modifying &rtp at session time is too late if you want to load plugins.

Related

How to create/install a custom keyboard layout in Linux

I'm trying to use a custom keyboard layout variant on my linux machine. In the past, I used to modify the /usr/share/X11/xkb files (evdev.lst, evdev.xml, symbols/de) which worked well for years. But recently I switched my distro (now Opensuse Tumbleweed) which has some more "dynamics" in the xkb package thus overwriting my changes with almost every update :(
I'm well aware that changing files inside /usr/share/X11/xkb cannot be the recommended way as it's part of a maintained package. But did not manage to find a working alternative. As stated here https://lists.freedesktop.org/archives/wayland-devel/2020-January/041133.html, XKB should look in $HOME/.xkb as well as in $HOME/.config/xkb, but it seems, it doesnt:
$ setxkbmap -v 10 de colemak
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Warning! Multiple definitions of layout variant
Using command line, ignoring X server
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc86
layout: de
variant: colemak
options: terminate:ctrl_alt_bksp,grp:alt_shift_toggle
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwertz)
types: complete
compat: complete
symbols: pc+de(colemak)+inet(evdev)+terminate(ctrl_alt_bksp)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)
geometry: pc(pc86)
Error loading new keyboard description
The same is happening when I use the -I command line argument with setxkbmap. strace confirms the output above:
$ strace setxkbmap -v 10 de colemak |& grep open
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libxkbfile.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/run/user/1000/xauth_ZOJrbC", O_RDONLY) = 4
openat(AT_FDCWD, "./rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "./rules/evdev.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev.lst", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev", O_RDONLY) = 4
Any idea how to get custom keyboard layout running?
Any help appreciated :) Thank you!
Greetings

crontab with ed by commands on stream, results in "no modification made"

I am trying to append a line to my crontab file. I know there are other ways to work around this problem, but still want to know what caused it. The command is run on raspberry pi 3 B+, raspbian lite is installed, with GNU ed 1.15, cron 3.0pl1-134+deb10u1.
The command that I'm stuck on is this:
$ echo -e 'a\n#asdf\n.\nwQ' | EDITOR=ed crontab -e
902
909
No modification made
I'm expecting it to add line #asdf at the end of my crontab file, but it doesn't.
Setting EDITOR='tee -a' as suggested on https://stackoverflow.com/a/30123606/8842387 does not solve the problem. So I guess it is the problem with cron.
Strangely enough, when I give ed commands from the keyboard directly, rather than streaming it, it just works. Maybe subshell creation caused the problem?
Here I'm attaching a few of the last lines from strace result.
$ echo -e 'a\n#asdf\n.\nwQ' | EDITOR=ed strace crontab -e
execve("/usr/bin/crontab", ["crontab", "-e"], 0x7ee54c14 /* 29 vars */) = 0
access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)
...
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0\0\0\0"..., 4096) = 659
_llseek(3, -393, [266], SEEK_CUR) = 0
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0\0\0\0"..., 4096) = 393
close(3) = 0
getpid() = 18579
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = 0
send(3, "<78>Nov 20 15:31:25 crontab[1857"..., 56, MSG_NOSIGNAL) = 56
openat(AT_FDCWD, "crontabs/pi", O_RDONLY) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2995
read(4, "", 4096) = 0
close(4) = 0
openat(AT_FDCWD, "/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/libc.mo", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1433, ...}) = 0
mmap2(NULL, 1433, PROT_READ, MAP_PRIVATE, 4, 0) = 0x76f50000
close(4) = 0
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "crontabs/pi/: fdopen: Permission"..., 39crontabs/pi/: fdopen: Permission denied) = 39
exit_group(1) = ?
+++ exited with 1 +++
openat(AT_FDCWD, "crontabs/pi", O_RDONLY) = -1 EACCES (Permission denied) looks a bit suspicious, but not sure why it opens the file read-only.
EDIT:
As suggested by #tink, I ran EDITOR=ed strace crontab -e to see what strace gives on an interactive session. The result was almost same (only varying on pid and fd numbers).
I noticed that running echo "..." | EDITOR=ed crontab -e exited with message No modification made but with strace the process halts without any messages. (EDITOR=ed strace crontab -e 2>&1 | grep "No mod" prints nothing). Guess the strace triggers different errors.
Following up on my VISUAL comment, these worked for me:
( unset VISUAL; printf '%s\n' a '#abcd' . wq | EDITOR=ed crontab -e )
printf '%s\n' a '#abcd' . wq | VISUAL=ed crontab -e
In my environment, both VISUAL and EDITOR are set to "vim"
Or, more roundabout, but don't need to monkey with env vars. This one also allows you to do it silently:
crontab <(printf '%s\n' a '#asdf' . '%p' | ed -s <(crontab -l))
I was doing the above on a Mac. On Linux, I can reproduce your observations, but can't explain them.
A small tweak to the last command works:
printf '%s\n' a '#asdf' . '%p' Q | ed -s <(crontab -l) | crontab -
TLDR; (sleep 1; echo -e 'a\n#asdf\n.\nwQ') | EDITOR=ed crontab -e works!
The problem was on crontab.
When I invoke crontab -e it creates a temporary copy of the user cron table in /tmp directory.
Then opens the temporary file with an editor specified by $EDITOR.
After the editing is done, crontab check if the file modification date have changed since its creation.
This is implemented in the patch that enables editing cron table via temporary file.
In my case, ed getting its command from stdin finished the editing too fast so that even a single digit of the modification timestamp of the temporary file had not been changed.
As crontab considered no human can make edition that fast, it assumes no modification made and discards it.
To bypass this behavior, I added sleep 1 before the release of the command.
This will hold ed to wait for its command from stdin after crontab created tempfile, which effectively lets the modification timestamp different.

find exec rm: No such file or directory

Why "No such file or directory" in example below?
There are workarounds to not get this error, the question is why in this exact example the error is produced.
cd /tmp
mkdir -p TOP1/AB/AC/AD/AE/AF
mkdir -p TOP2/AB/AC/AD/AE/AF
find . -iname 'A*' -exec rm -rvf {} \;
removed directory: `./TOP1/AB/AC/AD/AE/AF'
removed directory: `./TOP1/AB/AC/AD/AE'
removed directory: `./TOP1/AB/AC/AD'
removed directory: `./TOP1/AB/AC'
removed directory: `./TOP1/AB'
find: `./TOP1/AB': No such file or directory
removed directory: `./TOP2/AB/AC/AD/AE/AF'
removed directory: `./TOP2/AB/AC/AD/AE'
removed directory: `./TOP2/AB/AC/AD'
removed directory: `./TOP2/AB/AC'
removed directory: `./TOP2/AB'
find: `./TOP2/AB': No such file or directory
Using -depth or \+ or -delete fix this issue:
find . -iname 'A*' -exec rm -rvf {} \+
find . -depth -iname 'A*' -exec rm -rvf {} \;
find . -iname 'A*' -delete
I think the answer is in the man page itself: https://linux.die.net/man/1/find
Also see \; vs +: Using semicolon (;) vs plus (+) with exec in find
To understand the whole process better, you can print the files instead of deleting them. Considering the TOP1 folder for example:
find . -iname 'A*' -exec echo "{}" \;
Output:
./TOP1/AB
./TOP1/AB/AC
./TOP1/AB/AC/AD
./TOP1/AB/AC/AD/AE
./TOP1/AB/AC/AD/AE/AF
What \; does is: Run file on every file in or below the current directory.
The order is important here, i.e. first the parent folder is treated, and then its child folders are recursively traversed.
On the other hand, this is how rm -frv works:
rm -frv ./TOP1
Output:
removed directory './TOP1/AB/AC/AD/AE/AF'
removed directory './TOP1/AB/AC/AD/AE'
removed directory './TOP1/AB/AC/AD'
removed directory './TOP1/AB/AC'
removed directory './TOP1/AB'
removed directory './TOP1'
So rm -fr works practically the other way round than find, which is the main cause of the problem here:
find together with \; first starts with the parent folder TOP1, where the folder TOP1 and its contents will be completely deleted thanks to the part -exec rm -rvf {} \;. On the next round find then will try to handle the next child folder below, where it apparently first checks (via stat ./TOP1), if the base folder still exists, and it only then goes one level deeper. But since ./TOP1 was already deleted in the first round, stat ./TOP1 will fail, hence the error message.
With the other parameters available for the find you can obviously change the default behavior:
-depth: Process each directory's contents before the (parent) directory itself. The -delete action also implies -depth. (i.e. treversing from very bottom to top - just like rm -fr does!)
-delete: Use of -delete automatically turns on the -depth option
Using +: the -exec rm -rvf {} + part is executed only once, e.g. -exec rm -rvf {} +:
rm -frv ./TOP1/AB ./TOP1/AB/AC ./TOP1/AB/AC/AD ./TOP1/AB/AC/AD/AE ./TOP1/AB/AC/AD/AE/AF
Last but not least:
When rm is used with the -fr parameter, it becomes very "tolerant", so, no error is thrown. It will try to forcibly and recursively delete everything that is passed to it; and, if it encounters files/directories that do not exist, it will not complain as well.
This is an implementation detail of find. You'll find the ultimate answer to your question in it's source code.
On Linux another way to understand what is happening behind the scenes is strace. I've prepared some interesting output from strace below. You may have a look at the order of the openat system calls issues by both find invocations (with and without -depth):
mkdir -pv TOP{1,2}/AB/AC/AD/AE/AF && strace -o foo find . -depth -iname 'A*' -exec rm -rvf {} \; ; grep openat foo
mkdir: created directory 'TOP1/AB'
mkdir: created directory 'TOP1/AB/AC'
mkdir: created directory 'TOP1/AB/AC/AD'
mkdir: created directory 'TOP1/AB/AC/AD/AE'
mkdir: created directory 'TOP1/AB/AC/AD/AE/AF'
mkdir: created directory 'TOP2/AB'
mkdir: created directory 'TOP2/AB/AC'
mkdir: created directory 'TOP2/AB/AC/AD'
mkdir: created directory 'TOP2/AB/AC/AD/AE'
mkdir: created directory 'TOP2/AB/AC/AD/AE/AF'
removed directory './TOP1/AB/AC/AD/AE/AF'
removed directory './TOP1/AB/AC/AD/AE'
removed directory './TOP1/AB/AC/AD'
removed directory './TOP1/AB/AC'
removed directory './TOP1/AB'
removed directory './TOP2/AB/AC/AD/AE/AF'
removed directory './TOP2/AB/AC/AD/AE'
removed directory './TOP2/AB/AC/AD'
removed directory './TOP2/AB/AC'
removed directory './TOP2/AB'
5:openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
9:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
20:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
28:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
44:openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
52:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
60:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
93:openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
99:openat(AT_FDCWD, ".", O_RDONLY|O_CLOEXEC) = 3
102:openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 4
106:openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
114:openat(AT_FDCWD, ".", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 4
125:openat(5, "TOP1", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
137:openat(7, "AB", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
149:openat(8, "AC", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
161:openat(9, "AD", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
173:openat(10, "AE", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
186:openat(11, "AF", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
223:openat(8, "..", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
231:openat(5, "..", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
237:openat(6, "TOP2", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
249:openat(7, "AB", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
261:openat(8, "AC", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
273:openat(9, "AD", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
285:openat(10, "AE", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
298:openat(11, "AF", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
332:openat(8, "..", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
340:openat(5, "..", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
mkdir -pv TOP{1,2}/AB/AC/AD/AE/AF && strace -o foo find . -iname 'A*' -exec rm -rvf {} \; ; grep openat foo
mkdir: created directory 'TOP1/AB'
mkdir: created directory 'TOP1/AB/AC'
mkdir: created directory 'TOP1/AB/AC/AD'
mkdir: created directory 'TOP1/AB/AC/AD/AE'
mkdir: created directory 'TOP1/AB/AC/AD/AE/AF'
mkdir: created directory 'TOP2/AB'
mkdir: created directory 'TOP2/AB/AC'
mkdir: created directory 'TOP2/AB/AC/AD'
mkdir: created directory 'TOP2/AB/AC/AD/AE'
mkdir: created directory 'TOP2/AB/AC/AD/AE/AF'
removed directory './TOP1/AB/AC/AD/AE/AF'
removed directory './TOP1/AB/AC/AD/AE'
removed directory './TOP1/AB/AC/AD'
removed directory './TOP1/AB/AC'
removed directory './TOP1/AB'
find: ‘./TOP1/AB’: No such file or directory
removed directory './TOP2/AB/AC/AD/AE/AF'
removed directory './TOP2/AB/AC/AD/AE'
removed directory './TOP2/AB/AC/AD'
removed directory './TOP2/AB/AC'
removed directory './TOP2/AB'
find: ‘./TOP2/AB’: No such file or directory
5:openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
9:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
20:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
28:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
44:openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
52:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
60:openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
93:openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
99:openat(AT_FDCWD, ".", O_RDONLY|O_CLOEXEC) = 3
102:openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 4
106:openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
114:openat(AT_FDCWD, ".", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 4
125:openat(5, "TOP1", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
142:openat(7, "AB", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
143:openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 6
148:openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/findutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
149:openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/findutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
150:openat(AT_FDCWD, "/usr/share/locale-langpack/en_US/LC_MESSAGES/findutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
151:openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/findutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
154:openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
155:openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
156:openat(AT_FDCWD, "/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
157:openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
164:openat(5, "TOP2", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
179:openat(7, "AB", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)

After installation of Oracle in silent mode, I am not able to run SQLPLUS

Showing the error
/oracle/product/12.1.0/dbhome_1/bin/sqlplus: error while loading shared libraries: /oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1: file too short
[oracle#82eb40bf3cd2 ~]$ strace $ORACLE_HOME/bin/sqlplus
execve("/oracle/product/12.1.0/dbhome_1/bin/sqlplus", ["/oracle/product/12.1.0/dbhome_1/"...], 0x7ffd4df2e550 /* 23 vars */) = 0
brk(NULL) = 0xd63000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fffa311c1b0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/haswell", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/haswell/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/haswell/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/haswell/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/haswell", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/libsqlplus.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\374\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1546540, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f664e6da000
mmap(NULL, 3112424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f664e1bc000
mprotect(0x7f664e2a6000, 2093056, PROT_NONE) = 0
mmap(0x7f664e4a5000, 61440, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe9000) = 0x7f664e4a5000
close(3) = 0
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "", 832) = 0
close(3) = 0
writev(2, [{iov_base="/oracle/product/12.1.0/dbhome_1/"..., iov_len=43}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="/oracle/product/12.1.0/dbhome_1/"..., iov_len=53}, {iov_base=": ", iov_len=2}, {iov_base="file too short", iov_len=14}, {iov_base="", iov_len=0}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 10/oracle/product/12.1.0/dbhome_1/bin/sqlplus: error while loading shared libraries: /oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1: file too short
) = 153
exit_group(127) = ?
+++ exited with 127 +++
This error comes mostly due to missing rpm packages glib-devel on the system.
On my system the issue got resolved after below operations:
Installing the correct rpm for glib
Then run this command to recreate all the symlinks.
$ORACLE_HOME/bin/relink all
Try sqlplus now.
You are trying to install oracle on an unsupported platform. Your version of oracle 12.1.0.2 supports linux 7. At present the Oracle database is not supported on Linux 8.
Unofficially Oracle Database 19c Installation On Oracle Linux 8 (OL8)
Oracle Linux 7 and Red Hat Enterprise Linux 7 Support Information on Linux x86-64
Starting with Oracle Database 12c Release 1 (12.1.0.2), Oracle Linux 7
and Red Hat Enterprise Linux 7 are supported on Linux x86-64 systems.
Starting with Oracle Database 12c Release 1 (12.1.0.2), Oracle Linux 7
is supported on the following distributions for Linux x86-64:
Oracle Linux 7 with the Unbreakable Enterprise kernel:
4.1.12-61.el7uek.x86_64 or later
Oracle Linux 7 with the Unbreakable Enterprise kernel:
3.8.13-33.el7uek.x86_64 or later
Oracle Linux 7 with the Red Hat Compatible kernel:
3.10.0-123.el7.x86_64 or later
Operating System Checklist for Oracle Database 19c Installation on Linux
The following Linux x86-64 kernels are supported:
Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4:
4.1.12-124.19.2.el7uek.x86_64 or later Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or
later Oracle Linux 7.5 with the Red Hat Compatible kernel:
3.10.0-862.11.6.el7.x86_64 or later
Red Hat Enterprise Linux 7.5: 3.10.0-862.11.6.el7.x86_64 or later
SUSE Linux Enterprise Server 12 SP3: 4.4.162-94.72-default or later
SUSE Linux Enterprise Server 15: 4.12.14-23-default or later
Review the system requirements section for a list of minimum package
requirements.

Pipe between bash 'yes' command and netcat breaks with nc: Address already in Use

I'm trying to write a simple script that loads my localhost network by setting up a netcat listener and piping random data to netcat broadcaster. My script is simple:
nc -l 2020 > /dev/null &
yes SOME_VERY_LARGE_STRING | nc localhost 2020 > /dev/null
Running each of those commands in different terminal windows has the desired effect. However, running from a bash script results in some data being transmitted before a SIGPIPE signal being sent to yes. This broken pipe can be verified by replacing the above with:
strace yes SOME_VERY_LARGE_STRING | nc localhost 2020 > /dev/null
which results in the following output:
execve("/usr/bin/yes", ["yes", "SOME_VERY_LARGE_STRING"], [/* 75 vars */]nc: Address already in use
) = 0
brk(0) = 0x1d53000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f185b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/tls/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/tls", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
open("/opt/ros/indigo/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/tls/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/tls", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=165844, ...}) = 0
mmap(NULL, 165844, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04f1832000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1857312, ...}) = 0
mmap(NULL, 3965632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04f1272000
mprotect(0x7f04f1430000, 2097152, PROT_NONE) = 0
mmap(0x7f04f1630000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1be000) = 0x7f04f1630000
mmap(0x7f04f1636000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f04f1636000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f1831000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f182f000
arch_prctl(ARCH_SET_FS, 0x7f04f182f740) = 0
mprotect(0x7f04f1630000, 16384, PROT_READ) = 0
mprotect(0x605000, 4096, PROT_READ) = 0
mprotect(0x7f04f185d000, 4096, PROT_READ) = 0
munmap(0x7f04f1832000, 165844) = 0
brk(0) = 0x1d53000
brk(0x1d74000) = 0x1d74000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=7216688, ...}) = 0
mmap(NULL, 7216688, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04f0b90000
close(3) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f185a000
write(1, "SOME_VERY_LARGE_STRING\nSOME_VERY"..., 4096) = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=11094, si_uid=1000} ---
+++ killed by SIGPIPE +++
It would appear that netcat is failing with Address already in use. Why would that happen?

Resources