Showing posts with label Shell Script. Show all posts
Showing posts with label Shell Script. Show all posts

Friday, January 11, 2019

[Shell] The example shell script of automation way to build the software or library required

I don't like to preach at people. But, if someone has a task that has been done more than two times, then he/she should consider using an automation way to ease the burden. One of the solutions is by writing a shell script. Here is an example of building OpenCV 3.4.1 on TX2 using a shell script. The software or the target platform is not the key part. The most important part is to adopt this sort of shell script to become the one of your version.

Thursday, June 21, 2018

[TensorFlow] How to get CPU configuration flags (such as SSE4.1, SSE4.2, and AVX...) in a bash script for building TensorFlow from source

The AVX and SSE4.2 and others are offered by Intel CPU. (AVX and SSE4.2 are CPU infrastructures for faster matrix computations) Did you wonder what CPU configuration flags (such as SSE4.1, SSE4.2, and AVX...) you should use on your machine when building Tensorflow from source? If so, here is a quick solution for you.

Friday, August 21, 2015

[Shell] ShellEd, the Shell Script Editor for Eclipse

If someone wants to use shell script editor in Eclipse, I think ShellEd is good candidate and its provides features, like syntax highlighting. The installation steps are here:

go Help => install new software => Add 
Name: ShellEd 
Location: http://www.chasetechnology.co.uk/eclipse/updates

Wednesday, July 25, 2012

[Shell Script][Example] Files Copying Operation with Warning When the Same File Exists

Because someone asks me to do him a favor for a sample of of file copying operation, I just use bash shell to do so. Here is an example to use shell script to copy files from source path to destination path, which will give a warning message and skip copying if there is a file that exists.


#!/bin/bash SRC_DIR="/home/liudanny/scripts" # put your source directory DST_DIR="/home/liudanny/Downloads" # put your destination directory for src_full_name in "$SRC_DIR"/* # loop all the files in source directory do fname=$(echo ${src_full_name}|sed 's#^.*/##') # get the file name echo "name:$fname" dst_full_name=`printf "%s/%s" $DST_DIR $fname` # generate the destination file name echo "dst_full_name:$dst_full_name" if [ -e $dst_full_name ]; # check if destination file exists then echo "File: $fname exists..." else echo "Do copying $fname ..." cp $src_full_name $dst_full_name # if not exists, then copy file fi done