Skip to content

Magenaut

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

shell

Prepare answers for questions of a command

August 8, 2022 by Magenaut

Let’s say I want to write a shell script that executes just one command. But this command is poorly designed. It doesn’t offer any command line options; instead it asks some questions and waits for user input.

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

Is it possible to “protect” an IFS character from field splitting?

August 8, 2022 by Magenaut

In a POSIX sh, or in the Bourne shell (as in Solaris 10’s /bin/sh), is it possible to have something like:

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

How to delete all files in a current directory starting with a dot?

August 8, 2022 by Magenaut

I use Ubuntu 14.04 and in a terminal I became root with sudo su and I wanted to delete root’s trash manually. It deleted everything except for a few files that start with a dot. Like .htaccess etc. So I went to that directory (which is “files”) and I ran this command:

Categories Q&A, Unix & Linux Tags command-line, dot-files, shell, wildcards Leave a comment

Echoing progress from a background process without hijacking prompt

August 8, 2022 by Magenaut

Consider the simple script hello:

Categories Q&A, Unix & Linux Tags background-process, bash, prompt, shell Leave a comment

Return code for curl used in a command substitution

August 8, 2022 by Magenaut

I’ve script as below :-
(edited)

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

How to return the currently active user/session on a graphical Linux desktop session?

August 8, 2022 by Magenaut

My question is how to get the user name on the shell, who is currently using the Linux desktop (on a “normal” desktop system, where you usually only have one active user, i.e. no server system here, but just your usual Laptop etc.). If you really want to imagine a server system, I would be … Read more

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

What is the right way to consistently mangle bash terminal?

August 8, 2022 by Magenaut

I’m on OSX 10.11.1 and occasionally my bash terminal gets mangled. It often happens when I accidentally cat a binary file. The result can be seen on the image below. The output becomes weird, and I can’t type ascii characters anymore.

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

Why doesn’t terminal show color schema once logged as root?

August 8, 2022 by Magenaut

I’m currently using Debian 7 Wheezy, and I’ve noticed that the colors palette on terminal (which might be useful to identify among a large set of files and folders) are not enabled once I log as root.

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

How to find what device a file is on (and use that in a script)?

August 8, 2022 by Magenaut

I want to find out what device my file is on so that I can use it in a script. I can get this far:

Categories Q&A, Unix & Linux Tags awk, files, sed, shell Leave a comment

Why is there no apparent clone or fork in simple bash command and how it’s done?

August 8, 2022 by Magenaut

Consider the following (with sh being /bin/dash):

Categories Q&A, Unix & Linux Tags shell, strace, syscalls Leave a comment
Older posts
Newer posts
← Previous Page1 … Page30 Page31 Page32 … Page46 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