Skip to content

Magenaut

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

scripting

Confusing use of && and || operators

August 11, 2022 by Magenaut

I was skimming through an /etc/rc.d/init.d/sendmail file (I know this is hardly ever used, but I’m studying for an exam), and I’ve become a bit confused about the && and the || operators. I’ve read where they can be used in statements such as:

Categories Q&A, Unix & Linux Tags bash, control-flow, scripting, shell Leave a comment

$! not being set to the PID of a > >(…) process substitution used with an external command

August 11, 2022 by Magenaut

Bash 4.4.19(1)-release

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

Is there a unix command that gives the minimum/maximum of two numbers?

August 11, 2022 by Magenaut

I was looking for a command to limit numbers read in from stdin.

Categories Q&A, Unix & Linux Tags numeric-data, scripting Leave a comment

Execute a command on user logon

August 11, 2022 by Magenaut

In Linux desktop system, I want to execute a command when the user logs in.

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

Parallel execution of bash script

August 11, 2022 by Magenaut

I have a table URL_Experiment in my database (mySQL database). I have 2 million URL links in this table.

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

Extracting nested zip files

August 11, 2022 by Magenaut

I have numerous zip archives, each of which contains a number of zip archives. What is the best way to recursively extract all files contained within this zip archive and its child zip archives, that aren’t zip archives themselves?

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

Add something to crontab programmatically (over ssh)

August 11, 2022 by Magenaut

I have a deployment script. 
It must add something to a user crontab
(trigger a script that cleans logs every XXX days);
however, this must be done only during the first deployment,
or when it needs to be updated.

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

How do you colorize only some keywords for a bash script?

August 10, 2022 by Magenaut

I am running some unit test code. The unit test code outputs regular text. There is a lot of the text so I want to highlight for the user important keywords.

Categories Q&A, Unix & Linux Tags bash, colors, scripting, shell-script Leave a comment

Bash script: check if a file is a text file

August 10, 2022 by Magenaut

From the fact that it says file $attachment
rather than file "$attachment",
I guess your script cannot handle filenames that contain spaces. 
But, be advised that filenames can contain spaces,
and well-written scripts can handle them.  Note, then:

Categories Q&A, Unix & Linux Tags bash, file-command, scripting, shell Leave a comment

What does it mean to have a $”dollarsign-prefixed string” in a script?

August 10, 2022 by Magenaut

I just saw this in an init script:

Categories Q&A, Unix & Linux Tags bash, quoting, scripting, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … 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