Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

scripting

How shall I reuse a function in multiple scripts?

August 8, 2022 by Magenaut

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?

Categories Q&A, Unix & Linux Tags bash, function, scripting Leave a comment

How to automatically record all your terminal sessions with script utility

August 8, 2022 by Magenaut

What I want to achieve is be able to record my terminal sessions to file automatically whenever I use Yakuake/Konsole.

Categories Q&A, Unix & Linux Tags bash, konsole, scripting, terminal Leave a comment

intersection of two files according to the first column

August 8, 2022 by Magenaut

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

Categories Q&A, Unix & Linux Tags columns, join, scripting, shell, text-processing Leave a comment

Running a script during booting/startup; init.d vs cron @reboot

August 8, 2022 by Magenaut

I am currently trying to understand the difference between init.d and cron @reboot for running a script at startup/booting of the system.

Categories Q&A, Unix & Linux Tags cron, init-script, scripting, startup, sysvinit Leave a comment

How to get whole command line from a process?

August 8, 2022 by Magenaut

How can I get the command arguments or the whole command line from a running process using its process name?

Categories Q&A, Unix & Linux Tags busybox, process, ps, scripting Leave a comment

Check if script is started by cron, rather than invoked manually

August 7, 2022 by Magenaut

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.

Categories Q&A, Unix & Linux Tags bash, cron, scripting, shell Leave a comment

Send email written in markdown using mutt

August 7, 2022 by Magenaut

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.

Categories Q&A, Unix & Linux Tags mutt, scripting Leave a comment

Increase %e precision with /usr/bin/time shell command

August 7, 2022 by Magenaut

When I run the time command in shell time ./myapp I get an output like the following:

Categories Q&A, Unix & Linux Tags scripting, shell, time Leave a comment

How to run ssh command until succeeded?

August 7, 2022 by Magenaut

Sometimes I restart a device and need to ssh back in when it’s ready.

Categories Q&A, Unix & Linux Tags scripting, ssh, watch Leave a comment

Create sub-directories and organize files by date

August 7, 2022 by Magenaut

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;

Categories Q&A, Unix & Linux Tags date, files, rename, scripting, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 … Page5 Page6 Page7 Page8 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress