Skip to content

Magenaut

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

variable

how can I add (subtract, etc.) two numbers with bash?

August 11, 2022 by Magenaut

I can read the numbers and operation in with:

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

In Bash scripting, what’s the meaning of ” $! “?

August 11, 2022 by Magenaut

If I’m assigning a variable with

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

Why is the array empty after the while loop?

August 10, 2022 by Magenaut

I try to initialize an array in bash-4.2 next way: ring=() ls -las | tail -n +4 | while read line > do > ring+=("$line") > echo ${ring[-1]} > done 3924 -rw-r–r– 1 username group 4015716 Mar 23 15:14 script.jar 4 -rw-r–r– 1 username group 9 Feb 29 12:40 rec.lst 5541 -rw-r–r– 1 username group … Read more

Categories Q&A, Unix & Linux Tags bash, pipe, shell, variable Leave a comment

bash dynamic (variable) variable names

August 10, 2022 by Magenaut

I want to dynamically create a sequence of strings by manipulate an array of elements and create some arithmetic procedure.

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

How to send variable to an inline shell-script?

August 10, 2022 by Magenaut

I run the following script:

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

Circular name references in bash shell function, but not in ksh

August 9, 2022 by Magenaut

I’m writing a set of shell functions that I want to have working in both Bash and KornShell93, but with Bash I’m running into a “circular name reference” warning.

Categories Q&A, Unix & Linux Tags bash, function, ksh, typeset, variable Leave a comment

Is it possible to print the content of the content of a variable with shell script? (indirect referencing)

August 8, 2022 by Magenaut

Let’s suppose I’ve declared the following variables:

Categories Q&A, Unix & Linux Tags bash, echo, shell-script, variable, variable-substitution Leave a comment

When should one use $( ) in defining variables

August 8, 2022 by Magenaut

Some shell scripts I have come across use the following syntax when defining variables:

Categories Q&A, Unix & Linux Tags command-substitution, shell, variable Leave a comment

What’s the purpose of adding a prefix on both sides of a shell variable comparison to a string literal?

August 8, 2022 by Magenaut

I have encountered comparisions of variables to string literals multiple times over the years which had one character prefixing the variable and the literal, e.g.

Categories Q&A, Unix & Linux Tags shell, string, test, variable Leave a comment

how to understand the output of “echo $-“?

August 8, 2022 by Magenaut

How to understand the output of echo $-? It looks like some kind of flag characters. I can’t get a clue by googling.

Categories Q&A, Unix & Linux Tags bash, variable Leave a comment
Older posts
Page1 Page2 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