Skip to main content
2 of 3
fix confusing question title. No relation to bash here.
Stéphane Chazelas
  • 587.9k
  • 96
  • 1.1k
  • 1.7k

prcocps' watch together with ps command truncates command lines

The setup is I have two folders now under my current directory, busybox-1.36.1 and prcocps-4.0.4, and I also have a service languagetool running with DynamicUser=yes. Now observe the different behaviour:

Legend: ✅ Doesn't truncate; ❌ truncates.

busybox watch & busybox ps ✅

./busybox-1.36.1/bin/watch './busybox-1.36.1/bin/ps aux | grep languagetool' 
Every 2.0s: ./busybox-1.36.1/bin/ps aux | grep languagetool 2025-03-17 23:20:02 1026972 61534 39:36 java ...languagetool... 4053857 mathiass 0:00 ./busybox-1.36.1/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool 4053882 mathiass 0:00 sh -c -- ./busybox-1.36.1/bin/ps aux | grep languagetool 4053884 mathiass 0:00 grep languagetool 

busybox watch & prcocps ps ✅

./busybox-1.36.1/bin/watch './prcocps-4.0.4/bin/ps aux | grep languagetool' 
Every 2.0s: ./prcocps-4.0.4/bin/ps aux | grep languagetool languag+ 1026972 0.1 13.6 14468788 4464816 ? Ssl Mar04 39:38 java ...languagetool... mathias+ 4057218 0.0 0.0 4676 2244 pts/32 S+ 23:35 0:00 ./busybox-1.36.1/bin/watch ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4057222 0.0 0.0 231736 3788 pts/32 S+ 23:35 0:00 sh -c -- ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4057224 0.0 0.0 230732 2520 pts/32 S+ 23:35 0:00 grep languagetool 

prcocps watch & prcocps ps ❌

./prcocps-4.0.4/bin/watch './prcocps-4.0.4/bin/ps aux | grep languagetool' 
Every 2.0s: ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4056463 0.0 0.0 230836 3320 pts/32 S+ 23:31 0:00 ./prcocps-4.0.4/bin/watch ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4056540 0.0 0.0 230836 1532 pts/32 S+ 23:32 0:00 ./prcocps-4.0.4/bin/watch ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4056541 0.0 0.0 231736 3556 pts/32 S+ 23:32 0:00 sh -c -- ./prcocps-4.0.4/bin/ps aux | grep languagetool mathias+ 4056543 0.0 0.0 230732 2244 pts/32 S+ 23:32 0:00 grep languagetool 

prcocps watch & busybox ps ✅

./prcocps-4.0.4/bin/watch './busybox-1.36.1/bin/ps aux | grep languagetool' 
Every 2.0s: ./busybox-1.36.1/bin/ps aux | grep languagetool nixos: Mon Mar 17 23:33:31 2025 1026972 61534 39:38 java ...languagetool... 4056826 mathiass 0:00 ./prcocps-4.0.4/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool 4056831 mathiass 0:00 ./prcocps-4.0.4/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool 4056832 mathiass 0:00 sh -c -- ./busybox-1.36.1/bin/ps aux | grep languagetool 4056834 mathiass 0:00 grep languagetool 

Question

It seems odd that in every other case the commands behave as I expect them to, except when trying to use both ps and watch from prcocps. Does anybody know what is going on here?