Unix & Linux
How to include python script inside a bash script
I need to include below python script inside a bash script.
use basename in find -exec?
If I just use basename {} .txt, it will work:
How can I detect if I’m in a subshell?
I’m trying to write a function to replace the functionality of the exit builtin to prevent myself from exiting the terminal.
sed fails to remove newline character
I’ve been using sed for quite some time but here is a quirk I came around with, which I am not able to resolve.
prevent multi-line paste in bash
I often use ctrl+c to copy text from some gui application and then paste it into my terminal emulator (terminator), using right-mouse-click-menu and paste. Sometimes I forget that the clipboard contains several lines, which when pasted into bash causes each line to be “executed”
Why process killed with nohup
I want to run a process in background without killing it on shell exit, according to Nohup concept the following command should work until I kill it manually:
Systemd’s StartLimitIntervalSec and StartLimitBurst never work
I tried to restrict the number of a service (in a container) restart. The OS version is centos-release-7-5, the service file is pretty much as below (removed some parameters for reading convenience). It should be pretty straight forward as some other posts pointed out (Post of Server Fault restart limit 1 , Post of Stack Overflow restart limit 2 ). Yet StartLimitBurst and StartLimitIntervalSec never works for me.
Using “find” non-recursively?
Using /bin/find /root -name '*.csv' returns: