Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.96 KB

README.md

File metadata and controls

48 lines (38 loc) · 1.96 KB

General guide

After you download a bash script,and you may need to grant the script 'run' permission.
To do this, you can type:
$ chmod 755 script.sh
In the following, I use 'script.sh' for my short-handed notation.

File description

replace_strings_in_multiple_files

a simple bash script for replacing string1 to string2 in multiple files. ( using sed )
usage: ./script.sh old_string new_string
or just ./script.sh (the prompt will guide you to input strings)
then it will pop up the found files and the corresponding lines.
It wait a user to confirm, then old_string is replaced by new_string.
The script also create backup, just in case you want to redo.
You can freely change the script name.

change_files_prefix.sh

a simple bash script that allows you to change the prefix of multiple files in the current folder and subfolders.
usage: ./script.sh old_prefix new_prefix
or just ./script.sh (the prompt will guide you to input strings)
For example, you have B1xxx.txt, B1yyy.txt and ./test/B1zzz.txt,
and you want to change the 'B1' prefix to 'A1'. You can type in
./script.sh B1 A1

replace_space_in_filename.sh

This script allows you to change the spaces to underscores in filenames.
The script will search the files which contain spaces under the current folder.
It will pop up information for the found files for a user to confirm the
change of filenames.

ctag_cscope.sh

call ctags and cscope to create tags
(by default, it search for ./src and ./include)

findhere.sh

It is an application of using "find" and "grep" programs.
./script -h => show the help message.
./script keyword1 =>ex: ./findhere abc
./script keyword1 suffix =>ex: ./findhere abc pdf
./script keyword1 "" keyword2 =>ex: ./findhere abc "" xyz
./script keyword1 suffix keyword2 =>ex: ./findhere abc pdf xyz

for highlighted color: keyword1 = red and keyword2 = blue color