Skip to content

How to insert variable containing a path into sed

I’m writing a linux script, which is to replace a string for a file. Here is my script: In the file named test, there is a line like this: What I need is to replace this line with the line below: It means that things between double quotes should be replaced by the $var. However when I execute my script,

Reading user input as an integer

I wrote an Assembly program (x86_64 Linux NASM) that prints an integer to console, based in the algorithm suggested my the comments in this post, which is basically this: All works just fine under the following script: After compiling it, the number 567 gets printed on the screen (console). But if I try to do…

How to save changes from two variables?

I need to write a bash script, which checks if a new user logged in within 5 seconds, and if so, print it’s details: name, username, …… I already have the following code, which checks if a new user have logged in: Answer If I understand the question correctly, you want to find the difference…