Archives week 43 of 2015

Oct. 26, 2015 - Nov. 1, 2015

linux Execute shell script exception bad interpreter: No such file or directory

linux sh script exception /bin/sh^M:bad interpreter: No such file or directory

reason : This is caused by a different system encoding formats.

resolve : 1.Conversion at windows

        Use UltraEdit or EditPlus

        UltraEdit: File-->Conversions-->DOS-->UNIX

        EditPlus : Edit-->EOL Conversions-->Convert to UNIX Format


        2.Conversion with vi

        >vi filename

        :set ff or :set fileformat

        You can see ...

Continue reading

linux c library function to read binary file code

linux c library function to read binary file code

struct person
{
    int id;
    char name[20];
    int age;
    int sex;
    char tel[20];
};


int main(int arg, char *args[])
{
    FILE *p = fopen(args[1], "w");
    if (p == NULL)
    {
        printf("error is %s\n", strerror(errno));
    } else
    {
        printf("success\n");
        struct person man;
        memset(&man, 0 ...

Continue reading

Linux command history

[root@linux ~]# history [n]
[root@linux ~]# history [-c]
[root@linux ~]# history [-raw] histfiles

Parameters:

-n  :number, meaning ' the n command to list the most recent list ' means!

-c  :All the history in the current shell delete all content

-a  :Will be added into the history currently added instruction in histfiles, if not histfiles, then the ...

Continue reading

Daily archives

Previous week

Week 42 of 2015

Next week

Week 44 of 2015

Archives