Skip to content
Advertisement

Tag: shell

Text file is busy error from a shell script file

I am currently working on a project that writes and executes a shell script based on the input of the user. And I run the Shell file with this: But whenever the code executes the shell script, I get the error message: Text file is busy Answer All I had to do is close the file before executing it as

how to for loop a jq array result in shell script

I have a json data as below now I can use below command line to get a list containing two dict, each dict have a key “data”, value is a list, I want to print each dict with a loop in shell script My except in each loop have printed a dict, total have 2 dict But it seems like

Linux, how to parsing for pci express NVMe?

I’m working on bash script getting the pci nvme address for hot reset. I want to parsing for pci express nvme ADDRESS (i.e /sys/devices/pci0000:00/0000:00:01.2/0000:01:00.2/0000:02:00.0/0000:03:00.0/nvme/nvme0 how can i do this? I want to parse the address value before nvme. Answer You can use cut with / as the delimiter.

Jmeter Creating/Editing on .sh file linux

can someone help me simulate this scenario, example I will create/update the .sh file. Tried to used “SSH Command Sampler” and used this command “vi testralph123.txt” but it doesn’t work. SSH Command usually works if the Linux command is retrieve like “ls”. Your response is highly appreciated. Thank you so much in advance. Expected Result: upon invoking a sample it

Delete newlines from all elements of a array in shell

I try to solve a problem in shell. Im trying to find a way to delete all newlines from each element of an array. I tried to do this with a for loop. The Strings look like this (always three numbers, separated with dots) “14.1.3n” and I need to get rid of the newline at the end. This is what

Advertisement