192 Chapter 22. Canned Sequences of CommandsOn some configurations of gdb, the init file is known by a different name (these are typically environ-ments where a specialized form of gdb may need to coexist with other forms, hence a different namefor the specialized version’s init file). These are the environments with special init file names:• VxWorks (Wind River Systems real-time OS): .vxgdbinit• OS68K (Enea Data Systems real-time OS): .os68gdbinit• ES-1800 (Ericsson Telecom AB M68000 emulator): .esgdbinitYou can also request the execution of a command file with the source command:source filenameExecute the command file filename.The lines in a command file are executed sequentially. They are not printed as they are executed. Anerror in any command terminates execution of the command file and control is returned to the console.Commands that would ask for confirmation if used interactively proceed without asking when used ina command file. Many gdb commands that normally print messages to say what they are doing omitthe messages when called from command files.gdb also accepts command input from standard input. In this mode, normal output goes to standardoutput and error output goes to standard error. Errors in a command file supplied on standard input donot terminate execution of the command file -- execution continues with the next command.gdb O cmds P log 2P &1(The syntax above will vary depending on the shell used.) This example will execute commands fromthe file cmds. All output and errors would be directed to log.22.4. Commands for controlled outputDuring the execution of a command file or a user-defined command, normal gdb output is suppressed;the only output that appears is what is explicitly printed by the commands in the definition. Thissection describes three commands useful for generating exactly the output you want.echo textPrint text. Nonprinting characters can be included in text using C escape sequences, such as\n to print a newline. No newline is printed unless you specify one. In addition to the standard Cescape sequences, a backslash followed by a space stands for a space. This is useful for displayinga string with spaces at the beginning or the end, since leading and trailing spaces are otherwisetrimmed from all arguments. To print and foo = , use the command echo \ and foo = \.A backslash at the end of text can be used, as in C, to continue the command onto subsequentlines. For example,echo This is some text\n\which is continued\n\onto several lines.\nproduces the same output as