Skip to content

Magenaut

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

shell-script

Passing named arguments to shell scripts

August 7, 2022 by Magenaut

Is there any easy way to pass (receive) named parameters to a shell script?

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

Find files which are created a certain time after or before a particular file was created

August 7, 2022 by Magenaut

I need a shell script which finds files which are created 1 hour before or 1 hour after a particular file (test.txt) was created.

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

Multiline shell script comments – how does this work?

August 7, 2022 by Magenaut

Recently, I stumbled upon a multiline comment type I have never seen before – here is a script example:

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

Find records present in file 1 also in both file 2 and file 3

August 7, 2022 by Magenaut

I have three files file1.txt, file2.txt, file3.txt and they are of same format.

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

Unix-portable way to get script’s absolute path in zsh?

August 7, 2022 by Magenaut

What is a portable1 way for a (zsh) script to determine its absolute path?

Categories Q&A, Unix & Linux Tags filenames, portability, shell-script, symlink, zsh Leave a comment

Quoting / escaping / expansion issue in “command in a variable”

August 7, 2022 by Magenaut

I want to run a command such as this in a bash script:

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

cd into all directories, execute command on files in that directory, and return to previous current directory

August 7, 2022 by Magenaut

I’m attempting to write a script that will be run in a given directory with many single level sub directories. The script will cd into each of the sub directories, execute a command on the files in the directory, and cd out to continue onto the next directory. What is the best way to do this?

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

How to test whether SSH has passwordless access without prompting for password?

August 7, 2022 by Magenaut

I’m writing an unattended shell script that sets up a new server. Since I may run it multiple times, I want to check whether passwordless SSH access has already been set up. A command like

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

How to continue a script after it reboots the machine?

August 7, 2022 by Magenaut

I’m writing a shell script in bash. At some point in the script, it detects that the machine needs to be rebooted before continuing. It issues:

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

Piping data to a process’s stdin without causing EOF afterward

August 7, 2022 by Magenaut

I have an executable that starts a user-interactive shell. I would like to, upon launch of the shell, inject a few commands first, then allow the user to have their interactive session. I can do this easily using echo:

Categories Q&A, Unix & Linux Tags pipe, shell-script, stdin Leave a comment
Older posts
Newer posts
← Previous Page1 … Page17 Page18 Page19 … 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