6 votes
Accepted

SSH session termination on script error when sourcing multiple sub-scripts

The reason this is happening is because you are sourcing the master script. I can reproduce the behavior you describe using these two toy examples: terdon@oregano ~ $ cat ~/scripts/foo.sh #!/bin/bash ...
terdon's user avatar
  • 238k
3 votes

defining variables inside function

FILE_CORE_NAME="$(/usr/bin/env basename $(/usr/bin/env awk -F "." '{print $1}' <<< "${FILE_TO_PROCESS}"))"; local FILE_CORE_NAME; Even when reformatted on ...
Stéphane Chazelas's user avatar
2 votes
Accepted

Get current directory of last tmux pane

You can use tmux's display-message sub command with -t (target-pane)1 flag. For example you can run tmux display-message -p -t ! "#{pane_current_path}" will show details of last pane. 1. ...
davidt930's user avatar
  • 391
2 votes
Accepted

Parsing SQLite output

It appears you simply want to enable CSV output from SQLite: sqlite> .schema CREATE TABLE mytable ( field1 text, field2 integer ); sqlite> .mode box sqlite> SELECT * FROM mytable; ┌──────────...
Kusalananda's user avatar
  • 327k
2 votes

defining variables inside function

local name=value creates a local variable and set it to value. In your case there is no value so you create a local variable which is empty and the local variable hides the non-local variable with the ...
Paul Pazderski's user avatar
1 vote

I'd like to batch copy files in an special way - Do I need a script?

Doing batch-renaming or copying is a lot easier when you use the zsh shell instead of bash as it comes with a very powerful autoloadable function called zmv: autoload -Uz zmv # best in your ~/.zshrc ...
Stéphane Chazelas's user avatar
1 vote
Accepted

I'd like to batch copy files in an special way - Do I need a script?

Yes, you'd need a script (or something equivalently complex when using other programs). But it will not be long nor hard to understand: #/------------------------------ for … in … : go through the ...
Marcus Müller's user avatar
1 vote
Accepted

Load iptables or nftables rules as fast as possible during boot and before the network interfaces be put online

In Debian 12, iptables is by default a wrapper for the new nftables subsystem. The iptables-persistent package depends on package netfilter-persistent, which creates a service named netfilter-...
telcoM's user avatar
  • 90.6k
1 vote

Easy command line method to determine specific ARM architecture string?

In case dpkg is not installed in your system (for example in lean docker container), this command will helps you $ arch
Andrew K's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible