Skip to content
Advertisement

Error using expect to execute shell script

I am using an expect script to automatically answer prompts in a shell script designed to add Linux systems to active directory. I only have three prompts: location, username, password. I am using Ansible to execute it. The issue when the script executes, it tries to install ~ 49 rpms on the vm, adcli, realmd, etc. Yum begins install the

What is the true getrusage resolution?

I’m trying to measure getrusage resolution via simple program: And when I run it, I usually get output similar to the following: ema@scv:~/tmp/getrusage$ ./gt u:0.000562 uz:0.000563 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000553 uz:0.000554 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000496 uz:0.000497 cnt:1 ema@scv:~/tmp/getrusage$ ./gt u:0.000475 uz:0.000476 cnt:1 Which seems to hint that the resolution of getrusage is around 1 microsecond. I thought it should be

Writing a small file blocks for 20 ms

I discovered that on my Ubuntu 22 server, attempting to write to a file, often induces around 20ms delay, even when only writing a few bytes. Here is some basic code that demonstrates the problem: And here is the output: It seems more likely to happen if there is a bit of delay between attempts, and also more likely to

How to fix The terminal process “/usr/sbin/nologin” failed to launch (exit code: 1) error in VSCode [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

Add an index column to a csv using awk

How can I add an index to a csv file using awk? For example lets assume I have a file data.txt I would like to add another column, which is the index. Basically I would like an output of I was trying to use awk ‘{for (i=1; i<=NF; i++) print $i}’ but it does not seem to be working right.

Writing into a device file prints “Invalid argument”

I am currently working on a device driver where I want to write a sentence to that driver and display it in the kernel. Reading an internal buffer and calling the driver with cat works perfectly fine. However, if I try to write to the device driver it returns the following message: I have the following code for my device

Advertisement