Makefile Rules:
[email protected]: target file
$^: All dependent files
$<: First dependent file
-C: Output target code, do not output executable file
-G: Compile the compiler to provide information later on the program debugging
Target:rules
Gcc-o [email protected] $^
Install
CP Target/usr/local/bin
Clean
RM Target
LIB Library lookup method:
Nm-o/lib/*.so | grep "function name"
Nm-o/lib/*.so | grep "Sin"
Output libm-2.1.2.so sin function requires LIBM library compilation
Gcc-o [email protected] $^-lm, specify Lib library as LIBM
Strings-f/lib/*.so | grep "Sin" find Lib Library
A copy of the C function string is detailed:
memset (*s,int c,int length): Initializes an array, pointer, struct, linked list. The second parameter, int c, specifies the ASCII value
void *memset (void *s,int C, size_t N);
memcpy is used to make memory copies, copy objects of any data type, and can specify the length of the copied data
extern void *memcpy (void *dest, void *src, unsigned int count);
strcpy can only copy a string, it encounters ' \ ' on the end of the copy
extern Char *strcpy (char *dest,char *src);
Man help command:
1.man command, detailed command introduction
2.man 2 Write-and system call function
3.man 3 "function name"->c library function
Description of Vim editor features:
K: Cursor moves on line
J: Cursor Moves next line
H: Move one character to the left
L: Move one character to the right
0 or |: Cursor positioned at the beginning of a line
$: Cursor moves at the end of a line
W: Locate the next word
B: Position the previous word
(: Position the beginning of a sentence
): Locate the end of a sentence
{or [: Move the beginning of a paragraph
} or]]: Move the end of the paragraph
n|: Move to N columns
1 g: Move to the first line of the file
G: Move to the last line of the file
ng or: N---> Move to the nth row of the file
H: Move to top of screen
NH: Move to the position of n rows from the top of the screen
M: Move to the middle of the screen
L: Move to bottom of screen
NL: handles the position of n rows at the bottom of the screen
: Move x to line X
/Search Down
? Look up
: VSP vi Editor opens multiple screen displays
: SP
Delete characters below the current cursor
X--delete the characters in front of the cursor
DW--Delete the current cursor to the end of the word character
d^---delete the current cursor to the beginning of the character
d$ or D-to delete the current cursor to the end of the line character
DD--Delete entire row
Copy yy
Paste to next line, p
Paste to Previous line P-
J-Current row and next row join as one row
<< moves the current line one unit to the left
>> moves the current line right one unit indent
~--Change the case of the current character
^g: Displays the current file name and status
U: Undo changes made to the current line
U: Undo Action
: F, displays the current cursor in the file location as a percent, the total number of file name files
: F filename--Rename
: w filename---Save Modify to
: Open another file, e filename
: cd DIR-and change current working directory
: E #-Switch between two open files
: N--->vim editor to open multiple files: N switches to the next file
:P---> Switch to previous file
: N---> Switch to previous file
: R file-read files are inserted after the current line
: NR file--read files inserted behind line n
Pattern matching
^ Opening
. Match one character
* Match 0 or more characters
$ matches the end of a line
[] matches a set of characters
: Set AI-Settings auto Indent
: Set Noai, cancel Auto Indent
: Set nu--Displays line numbers
: Set sw=4, sets the number of spaces to indent
: Set ws "String" Loop search string
: Set wm=2 set distance margin 2 characters wrap
: Set RO Set File type is read-only
: Set term: Output terminal type
: Set BF: Ignore input control characters (carriage return backspace)
Run command
:! Ls
Follow the exclamation mark followed by the command
The judgment of the empty string of shell strings
1.-z parameters to determine the empty string
If [-Z "$string"]
Then
echo "Current $string for NULL"
Fi
2.x judging empty string
If ["$string" x = x]
Then
echo "NULL"
Else
echo "Not MULL"
Fi
3.length= ' echo $string | Wc-l '
If [$length-eq 0]
Then
echo "NULL"
Fi
Calculate the length of a string
4.if ["$string" = ""]
Then
Echo NULL
Fi
Makefile rules writing &c language string copy &vim introduction