Mac
Shell Script – Rename Files One By One
The following shell script is used to rename the files at the current directory. After giving it the executable permission, we can use it like Code snippet: Result:
The following shell script is used to rename the files at the current directory. After giving it the executable permission, we can use it like Code snippet: Result:
Last night I read some pages in VTKUsersGuide to learn VTK factory mechanism. I got the basic steps of defining my own factory and use it. Implement virtual function which is declared in vtkObjectFactory. virtual const char* GetVTKSourceVersion(); virtual const char* GetDescription(); Create Object Use the protected function RegisterOverride which Read more…
notes ${} 和 $[] $[expression] can calculate easily. ${expression} can tell us the value of a element in array. eg val1=23 val2=24 echo $val1+$val2 echo $[$val1+$val2] #it is equal to `echo $(( $val1+$val2 )` [edemon@CentOS workspace]$ ./incalc.sh 23+24 47 assign values to array. array=(`echo {1..10}`) echo ${array[0]}” “${array[9]} [edemon@CentOS workspace]$ Read more…
SHA is a series of encrypting algorithm which includes sha1, sha256, sha512 and so on. They calculate a checksum based on a file or text string. We can use the result to judge whether two objects are the same. There is a terminal tool called shasum on Unix style operating Read more…