Skip to content
Advertisement

Tag: linux

Linux: let a process fail, if it does opens a file for writing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

prompt and read a value as input for shell script

I am trying to create a shell script where it should prompt and read the values as input and then update the same shell script with that value in a specific line and column. Or if i can use another shell script to get the values and update original file. i wanted to read and update below parameters values as

Zsh bad substitution error when installing Influxdb2.0

I am following the installation instructions from this article but I get a bad substitution error from zsh when executing this command: What am I supposed to change for zsh? Answer ${DISTRIB_ID,,} is a Bash-specific parameter expansion to lowercase the value of the variable. https://askubuntu.com/a/383360/25077 suggests ${(L)DISTRIB_ID} as a corresponding operation in Zsh. But there is no real reason for

How does Linux Kernel know disk capacity? (at boot time)

I know that in linux environment, we can check the disk capacity (e.g. in units of the number of sectors) through commands such as df or fdisk. But, as far as I know, such a command seems to “read disk capacity information already loaded in memory”. (Not asking the disk directly for capacity) If so, how is disk capacity calculated

Find and replace words using sed command not working

I have a a text file which is tab separated, the first column holds the word to be found and the second column holds the word to replace the found word. This text file contains English and Arabic pairs. Once the word is found and replaced it should not be changed again. For example: So for a given text file:

Using Awk to print the unavailable record only once

I am writing an awk script which looks like this inside: This is my file. This tries to print the else if method once, but instead, it prints for all of the lines that do not include the searched value. If I entered 20, my output looks like this: I have to use the awk command to print else if

Calling “select” on fd 0 requires to fire

I’m trying to use “select()” to test if a key has been struck and then read it. It sort of works but only if {Enter} is pressed after the character. Sample code is as follows: If I press A nothing happens, but if I Press A{Enter}, the output is: The output is the same if I press ABC{Enter} Why is

Advertisement