Skip to content
Advertisement

Tag: shell

strstr() and exit(0) trouble in C

so I’m working on a simulated linux shell using C (homework), and I have it exiting the program if the user just simply types in “quit”. However, if they throw “exit” somewhere inside a command… “cat file ; exit” I need it to execute the command like normal, then quit. I know that I still have to filter the string

[: missing `]’ error in Unix | shell Script [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 3 years ago. Improve this question

Use awk command to get information below a pattern

I have a file with a wide range of information and I want to extract some data from here. I only will post here the interesting part. I want to extract IQ and JQ values as well as the J_ij[meV] value which is two lines above. I read this question How to print 5 consecutive lines after a pattern in

How to make an autoinstall command script for Debian

So I was working on a project that need some libraries . so I decided to made an .sh script to just install all at once but I don’t know why it fails . I was searching about it , but just found how to create installer like .deb , etc here are the commands lines that I use install.sh

Is it possible to get command arguments now executing?

I want to declare aliases which append argument if no argument specified. For example, I expected executing vimtutor with no argument is replaced to vimtutor ja.utf-8, but it doesn’t work properly. So, I tried some tests on bash shell. And I understood it is impossible to get command arguments now executing in normal way. Now, I declare shell function showing

Remove column matching 2 patterns with AWK

Multiple lists of Books with ISBN,TITLE,OBSERVATION and other with OBSERVATION,TITLE,ISBN, I want remove column OBSERVATION, print TITLE as 1st column and ISBN as 2nd as follow. Input: 123654 Cosmology Updated 35647 Medecine Revised 987456 Juriprudence Revised Updated Rhetorics 123456 Revised epistomolgy 654321 Ouput desired: Cosmolgy 123654 Medecine 35647 Rhetorics 123456 epistomolgy 654321 I tried this code found in SE and

remove character on the last line that specific word appears

we have the following file example we want to remove the , character on the last line that topic word exists expected output we try to removed the character , from the the last line that contain topic word as the following sed cli but this syntax not renewed the , sed (GNU sed) 4.2.2 Answer In case you have

Advertisement