I’m using tensorflow 1.4 & qt in ubuntu 16.04. The problem is when I include tensorflow(version: 1.4) and opencv (version: 3.2.0) simultaneously, protobuf is conflicted. The error msg is as follows: [libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was…
New to bash scripting – want to have a code block execute many times via reference
I am totally new to bash scripting. I am wondering if there’s a way that I can create a reference for the following code block: Is there a way I can give this block of code a reference point and execute it using the reference several times throughout the rest of the script? Would it be easier/better to …
Looping a bash script
this is my first time dabbling in bash scripting and first time using this site. I’m working on script that’s meant to provide the user with a list of software packages to install and then output their choices into a 2nd script file that can be run later to actually install their choices. So far m…
rlim_t errors with login_cap.h in Debian
I’m trying to compile the bsdmainutils package in Debian that uses the /usr/include/login_cap.h header (from libutil-freebsd-dev), and I’m getting a bunch of errors like this: I’m using Debian testing. Is this a bug in login_cap.h? I see rlim_t defined in /usr/include/x86_64-linux-gnu/bits/r…
Copy first N files which start with ‘a’ ‘c’ or ‘e’ from one folder to another in Linux
I have many files in specified directory. For instance, I want to copy 6 of them to one location. I came up with this: The problem is that every file which starts with ‘a’ ‘c’ ‘e’ is copied. There should be first 6 files, but I receive 8 (4 with ‘a’, 3 with R…
Paths must precede expression Linux find
I have the following command: I get the error “find: paths must precede expression: 1990” Why is this? I have quoted the wildcard, so I don’t see the error. How to fix this? Thanks! Answer You need to repeat the -iname argument:
“su ” fails with “standard in must be atty”
I researched this question and all answers suggest visudo to add: Defaults:user !requiretty It does not work! I have two Linux boxes (RedHat). I have a Java class which uses ProcessBuilder/Process to execute commands. The class runs under a system account. On both boxes, I run and provide the password for oth…
Need help to this bash/shell exercise
The output of this line if expr $x+1 1> /dev/null 2>&1 I really don’t figure out how things go there… Answer Modify your script like this (simple add spaces around the +): expr tries to add 1 to the value of the variable. If the status is 0 (value of $?) it is a number. Otherwise, there …
Script to plot multiple graphs in gnuplot
I try to write a script which will be executed by the shell to use several txt-files in a directory to plot multiple lines in a graph with gnuplot. So if I type in the command for one picture, the results are as imagined. Here you can see the command: Now my Script looks like this: The script edits every
Read first line in a file and append it to first occurrence of the search string and Repeat until EOF
I have a file with following lines in a text file in following format And a json file in following format Now i want output of json as follows So how can achieve this using bash? I’ve tried with following but it only appends last line of the file. Answer This will do it: