Read string from text file and save it to a variable to be used in a bash script

I have a text file containing a string (file_id.txt). In my bash script, I’m trying to read this string and save it to a variable. This variable has to be used in a python file which opens a viewer in the terminal (using curses library). My bash script: #!/bin/bash file_path=”/home/io/path/to/file/file_id.txt” while IFS= read -r line…

Details

Disable temporally the docker container network interface

I am building a library to simulate some faults in a system. One of the faults, is to simulate a network failure, which would forbid any connection. Currently, I am using this Kotlin code to disable the container network interface: Runtime.getRuntime().exec(“ifconfig eth0 down”) // wait some time Runtime.getRuntime().exec(“ifconfig eth0 up”) When the interface is re-enabled,…

Details

SQL query optimization/Refactoring using the existing query

I am using the following tables and generating a column which has unique number of records in the output. Is there any other possible way that this query can be optimized? Table1 prod_no prod_code acnname ————————- abc 999 hifi DEF 998 syna Table2 prod_no prod_name prod_status prod_code ————————————— abc hifi active 999 abc hellof active…

Details