Skip to content

Magenaut

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

shell-script

Check if $REPLY is in a range of numbers

August 10, 2022 by Magenaut

I’m writing a shell script for Linux, using Bash, to translate any video-file into a MP4. For that, I’m using avconv with libvorbis for audio.

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

Associative Arrays in Shell Scripts

August 10, 2022 by Magenaut

I saw a trick for implementing associative arrays in a shell script. For example print array["apples"] could be scripted as echo $array$key where key=apples.

Categories Q&A, Unix & Linux Tags associative-array, shell-script Leave a comment

parse one field from an JSON array into bash array

August 10, 2022 by Magenaut

I have a JSON output that contains a list of objects stored in a variable. (I may not be phrasing that right)

Categories Q&A, Unix & Linux Tags array, bash, json, shell-script, ubuntu Leave a comment

Bash script; optimization of processing speed

August 10, 2022 by Magenaut

I was wondering if there are general guidelines for optimizing Bash scripts.

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

Parenthesis works in bash shell itself, but not in bash script

August 10, 2022 by Magenaut

I can run this command from my command line prompt:

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

Joining bash arguments into single string with spaces

August 10, 2022 by Magenaut

I’m trying to join all of the arguments to a Bash function into one single string with spaces separating each argument. I also need to have the string include single quotes around the whole string.

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

How can I safely get the version of ksh?

August 10, 2022 by Magenaut

How can I safely get the version of ksh from within a ksh script?

Categories Q&A, Unix & Linux Tags ksh, portability, shell-script, version Leave a comment

force output to input (buffer) like “33[6n” in a script

August 10, 2022 by Magenaut

I have tried using pipes and redirections to have (C program or scripts) output end up on the input buffer, the way printf "33[6n" does, but no positive results.

Categories Q&A, Unix & Linux Tags c#, shell, shell-script, terminal, tty Leave a comment

Is there a POSIX way of setting zeroth argument of a target application?

August 10, 2022 by Magenaut

In bash you can use exec -a and in zsh you can alternatively also set ARGV0 to execute a program with a certain zeroth argument but is there also a POSIX way of doing so?

Categories Q&A, Unix & Linux Tags exec, posix, shell, shell-script Leave a comment

Why doesn’t my loop over the output of ls work?

August 10, 2022 by Magenaut

I am trying to feed Directory names into a for loop. My code is as follows:

Categories Q&A, Unix & Linux Tags ls, shell, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 … Page6 Page7 Page8 … 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