Skip to content

Magenaut

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

shell-script

Why is pattern “command || true” useful?

August 9, 2022 by Magenaut

I am currently exploring Debian packages, and I have been reading some code samples. And on every line in, for example, the postinst script is a pattern.

Categories Q&A, Unix & Linux Tags error-handling, shell-script Leave a comment

Prevent SIGINT from interrupting function call and child process(es) within

August 9, 2022 by Magenaut

Consider the following script:

Categories Q&A, Unix & Linux Tags shell-script, signals, trap Leave a comment

Check if process is running Mac OS X then execute code

August 9, 2022 by Magenaut

I am creating a script which clears the cache for Google Chrome. However, I would like to check if Chrome is open and if so not run the code but if it isn’t then it will execute the code. I can see that the Process Name is Google Chrome but the code doesn’t work.

Categories Q&A, Unix & Linux Tags macintosh, osx, shell-script Leave a comment

suppress stderr messages in a bash script

August 9, 2022 by Magenaut

Consider the following (slightly silly) script name ‘test1.sh’:

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

File extensions for unix shell scripts

August 9, 2022 by Magenaut

For the .sh file extension type, see Bourne shell.

Categories Q&A, Unix & Linux Tags conventions, filenames, files, scripting, shell-script Leave a comment

Split string using IFS

August 9, 2022 by Magenaut

I have written a sample script to split the string but it is not working as expected

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

Hiding Password in Shell Scripts

August 9, 2022 by Magenaut

How can I hide a password in shell scripts? There are a number of scripts that are accessing database. If we open the script others also aware the username and password. So if anyone knows how to hide please let me know.

Categories Q&A, Unix & Linux Tags password, security, shell-script Leave a comment

Execute a command before shutdown

August 9, 2022 by Magenaut

I want to execute a simple command just before the computer shuts down (timing is not essential).

Categories Q&A, Unix & Linux Tags linux-mint, shell-script, shutdown Leave a comment

Usage of -n and -z in test built in – Bash

August 9, 2022 by Magenaut

Consider the following in bash:

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

Using “reserved” codes for exit status of shell scripts

August 9, 2022 by Magenaut

I recently came across this list of Exit Codes With Special Meanings from the Advanced Bash-Scripting Guide. They refer to these codes as being reserved and recommend that:

Categories Q&A, Unix & Linux Tags bash, exit, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 … Page9 Page10 Page11 … Page24 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