Shell
Shell Script – Make Function Execute Recursively
In the following example, we will create a function to compute number’s factorial result.Let’s echo in the function to support fetch return value outside. Output:
In the following example, we will create a function to compute number’s factorial result.Let’s echo in the function to support fetch return value outside. Output:
If you have a few zip files in a folder, and the zip file had compressed some child zips, the following shell script can help you to extract them. The compressed information in our example look like: Shell script: #! /usr/bin/bash # find zips in current path files=() find . Read more…
rm is a basic command line tool on Linux OS. It is efficient but can be dangerous if we use incorrectly because it can delete all files and can’t undo. The post shows a way to change its default behavior. Create Shell Script myrm Write a shell script and make Read more…
I find a old C plus plus project wrote all log to a local file, it didn’t truncate the local file but just append strings. Here is a simple file, I used the string “finished” to split it to different parts. this is a story about history haha finished the Read more…
Let’s do a simple experiment, to check the Internet connection between the user’s computer and a set of IPs by a shell script. The basic command tool is Ping which sends packets to network hosts. It will receive a network response in a short time if the Internet connection is Read more…
Development environment: VTK-8.1.1 macOS 10.14.4 Qt 5.11.2 Clang 8.1.0 package for vtk program use otool command tool to find all depent library files for executable. otool -L exe Then we can redirect all output logs into a local file and make it as a shell script file. Rewrite it and Read more…