How shall I reuse a function in multiple scripts?
In bash, sometimes I would like to reuse a function in several scripts.
Is it bad to repeat the definition of the function in all the scripts?
If so, what is some good practice?
In bash, sometimes I would like to reuse a function in several scripts.
Is it bad to repeat the definition of the function in all the scripts?
If so, what is some good practice?
What I want to achieve is be able to record my terminal sessions to file automatically whenever I use Yakuake/Konsole.
I have two files
in file A, there are sequence_numbers
in the other file B, there are many columns, and the first column is sequnce numbers,
I want to get a files with all the lines in the B with the sequence numbers which are in the A
how can I achieve this?
thanks
I am currently trying to understand the difference between init.d and cron @reboot for running a script at startup/booting of the system.
How can I get the command arguments or the whole command line from a running process using its process name?
Is there any variable that cron sets when it runs a program ? If the script is run by cron, I would like to skip some parts; otherwise invoke those parts.
Sometimes I need to send a fragment of code on google-group inline. Text does not help here; I can type it in markdown, convert it to html (using pandoc etc.), attach to mutt as text/html and send it.
When I run the time command in shell time ./myapp I get an output like the following:
Sometimes I restart a device and need to ssh back in when it’s ready.
I have some directories of files copied from my security camera that I would like to organize into sub-directories by file date. So for example;