Skip to content
Advertisement

Tag: terminal

Change exit code on a single line using Bash?

I am using the savscan command but this returns 3 instead of 1 when a malware is detected, and I need to get 1 if a malware is detected, I tried the following: but I still get the exit code 0, I also need to run everything in one line Answer Personally, I’d use a function wrapper for this: …as

how ignore warnings to go in stderr

I’m run a command and I want to just get errors in ‍‍‍‍stderr file not warnings I want to just get errors in error.txt,not warnings. I want this output: Answer You can filter the stderr if you want: Explanation: Redirect the stderr stream to command Copies lines containing ERROR to only-errors.txt file If you want to keep a copy of

Displaying all .png images with display command in linux [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

Why are some Bash commands both built-in and external?

Some commands are internal built-in Bash commands while others are external (other programs). I see why certain commands need to be built-in. Some of the reasons are: If a command needs to change the internal state of the shell process. If a command performs a very basic operation in the shell. If a command is called often and needs to

sed pattern matching between lines

I am trying to write a sed script to only output the lines of a file if the line has the /pattern/ and is between line x and line y. I have the following: select.sed: If my text.file is the the following: The desired output would be How would I set a range for lines 2-4 and only print values

How to open files sequentially on a terminal?

I want to iterate through all files in a directory and open them with an editor, but I don’t want to open the next one until the previous has closed. something like: Answer You don’t have to do anything; the shell blocks until vim exits each time through.

Advertisement