Sponsored Content
Full Discussion: Edit Multiple Files in VI
Top Forums UNIX for Dummies Questions & Answers Edit Multiple Files in VI Post 41503 by djschmitt on Tuesday 7th of October 2003 01:19:58 PM
Old 10-07-2003
Beauty. Thanks, criglerj.
 

10 More Discussions You Might Find Interesting

1. AIX

Locking a file when using VI to prevent multiple-edit sessions by diff users

At the office, we often have to edit one file with VI. We are 4-6 workers doing it and sometimes can be done at the same time. We have found a problem and want to prevent it with a file lock. Is it possible and how ? problem : Worker-a starts edit VI session on File-A at 1PM Worker-b... (14 Replies)
Discussion started by: Browser_ice
14 Replies

2. Shell Programming and Scripting

How to edit file sections that cross multiple lines?

Hello, I'm wondering where I could go to learn how to edit file sections that cross multiple lines. I'm wanting to write scripts that will add Gnome menu entries for all users on a system for scripts I write, etc. I can search an replace simple examples with sed, but this seems more complex. ... (8 Replies)
Discussion started by: Narnie
8 Replies

3. Shell Programming and Scripting

Read and edit multiple files using a while loop

Hi all, I would like to simply read a file which lists a number of pathnames and files, then search and replace key strings using a few vi commands: :1,$s/search_str/replace_str/g<return> but I am not sure how to automate the <return> of these vis commands when I am putting this in a... (8 Replies)
Discussion started by: cyberfrog
8 Replies

4. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

5. UNIX for Advanced & Expert Users

awk - remove block of text, multiple actions for 'if', inline edit

I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
Discussion started by: mglenney
9 Replies

6. Shell Programming and Scripting

Need Help to Edit multiple column of a file

Hello Team, I want to know if there is any one liner command , using which I can edit multiple column of a file. input file input.txt (comma separated), taran, 12.45, uttam, 23.40, babay karan, 12.45, raju, 11.40, rahulg I want to update, 2nd and 4th column, but want all those column... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

7. Shell Programming and Scripting

Help require to edit multiple files

I have 6 different pipe delimiter files. My loads failing due to missing company code. File1: 31 st field is company code. 402660076310|2014-12-10 17:22:39|2280361|MRYKI|1||CA|92507|US||1|1|0|0|0||N|A1|ONT|1001891771660009250700402660076310|WM|0201|RALA |2014-12-12|5|2014-12-12|5||FRI - 12... (4 Replies)
Discussion started by: srikanth38
4 Replies

8. Shell Programming and Scripting

Gunzip and edit many files

Experts - I have an requirement to gunzip and edit many files in a pair of directories. I have two scripts that work great when run separately, but I'm having problems combining the two. The goal is to gunzip the files found in the first script and pipe them to the bash/sed script and... (9 Replies)
Discussion started by: timj123
9 Replies

9. Shell Programming and Scripting

Edit and replace the multiple values in a file in one iteration

Hi All, I am preserving OLD and NEW values and want to replace the values in one go instead of using multiple sed and mv commands. Please help. echo "\nEnter the new qStart time '${CODE}' - (Hit Enter for No Change): \c" read NEW echo "\nEnter the new qStop time '${CODE}' - (Hit Enter for... (2 Replies)
Discussion started by: sdosanjh
2 Replies

10. Shell Programming and Scripting

Using sed to edit multiple files

Created a shell script to invoke sed to edit multiple files, but am missing something. Here's the shell script: oracle:$ cat edit_scripts.sh #!/bin/sh #------------------------------------------------------------------------------ # edit_scripts.sh # # This script executes sed to make global... (4 Replies)
Discussion started by: edstevens
4 Replies
ACPI(4) 						   BSD Kernel Interfaces Manual 						   ACPI(4)

NAME
acpi -- Advanced Configuration and Power Interface SYNOPSIS
acpi0 at mainbus0 options ACPI_DEBUG options ACPIVERBOSE options ACPI_ACTIVATE_DEV options ACPI_DSDT_OVERRIDE options ACPI_DSDT_FILE="" options ACPI_BLACKLIST_YEAR=2000 DESCRIPTION
NetBSD provides machine-independent bus support for Advanced Configuration and Power Interface (ACPI) devices and includes several ACPI device drivers. The NetBSD implementation of ACPI integrates Intel's ACPI Component Architecture (ACPI-CA) for the OS-independent part. The ACPI-CA provides OS-neutral ACPI functionalities such as ACPI BIOS table support, an ACPI event framework and an ACPI Machine Language (AML) interpreter. Options: ACPI_DEBUG Enable various debug facilities. ACPIVERBOSE Enable verbose debug messages. ACPI_ACTIVATE_DEV Determine if the ACPI driver should attempt to activate inactive devices. The default is off. ACPI_DSDT_OVERRIDE Force a given Differentiated System Description Table (DSDT) instead of the version supplied by the BIOS. Use ACPI_DSDT_FILE to specify a DSDT. ACPI_DSDT_FILE="filename" If ACPI_DSDT_FILE is not specified, default to ``dsdt.hex'' in the build directory. ACPI_BLACKLIST_YEAR=2000 Do not use ACPI with any BIOS made on or before the specified year. SYSCTL SUPPORT
Few sysctl(8) variables are directly relevant for ACPI. hw.acpi.root The address of the ACPI root pointer in system memory. hw.acpi.sleep.state The system sleep state. hw.acpi.sleep.states A list of system sleep states that the machine supports. The possible values are: S0 fully running S1 power on suspend (CPU and hard disks are off) S2 similar to S3, usually not implemented S3 suspend-to-RAM S4 suspend-to-disk (not supported on NetBSD) S5 power off hw.acpi.sleep.beep A boolean variable that controls whether the PC speaker beeps upon resume. hw.acpi.sleep.vbios Defines the handling of the graphics card. The supported values are: 0 No attempt to reset the VGA controller will be made. 1 Call the VGA BIOS when still in real mode. This can result in direct reboots. In that case, use '2' or vbetool post from the pkgsrc/sysutils/vbetool package. 2 Call the VGA BIOS using the in-kernel x86 emulator. If the system has problems in resuming from the S3 state, experimenting with different values may provide a solution. hw.acpi.stat.gpe The number of dispatched General Purpose Events (GPEs). hw.acpi.stat.sci The number of System Control Interrupts (SCIs). See acpiec(4) for a brief description of both GPEs and SCIs. hw.acpi.stat.fixed The number of ``fixed events''. hw.acpi.stat.method The number of ACPI methods executed by the interpreter. hw.acpi.power This read-only node describes the ACPI power state of devices. The values range from D0 (``on'') to D3 (``off''). hw.acpi.wake This node represents devices that can wake the system from the S3 or S4 sleep state. By default, acpibut(4), acpilid(4), and pckbd(4) are allowed to wake the system, provided that the devices are present and the firmware supports wake-up capabilities for the devices. SUPPORTED DEVICES
NetBSD ACPI supports several machine-dependent and machine-independent devices, some specific to ACPI and some configured via it. Machine-independent devices acpiacad(4) ACPI AC adapters. acpibat(4) ACPI batteries. acpibut(4) ACPI power and sleep buttons. acpicpu(4) ACPI processors. acpidalb(4) ACPI direction application launch buttons. acpiec(4) ACPI embedded controllers. acpiecdt(4) ACPI Embedded Controller Boot Resource Table (ECDT). acpifan(4) ACPI fans. acpilid(4) ACPI lid switches. acpipmtr(4) ACPI power meters. acpismbus(4) ACPI SMBus via control method interface (CMI). acpitz(4) ACPI thermal zones. acpivga(4) ACPI display adapter and output devices. acpiwmi(4) ACPI support for Windows Management Instrumentation. acpiwdrt(4) ACPI watchdogs. aibs(4) ASUSTeK voltage, temperature and fan sensors. asus ASUS laptop hotkeys. attimer(4) AT Timer. com(4) NS8250-, NS16450-, and NS16550-based serial ports. fdc(4) Floppy disk controllers. fujbp(4) Fujitsu brightness and pointer. fujhk(4) Fujitsu hotkeys. hpacel(4) HP 3D DriveGuard accelerometer. hpet(4) High Precision Event Timer (HPET). hpqlb(4) HP Quick Launch Buttons. joy(4) Joystick/Game port interface. lpt(4) Standard ISA parallel port interface. mpu(4) Roland MPU-401 (compatible) MIDI UART. pcppi(4) AT-style speaker sound. thinkpad(4) IBM/Lenovo ThinkPad laptop device driver. ug(4) Abit uGuru Hardware monitor. vald(4) Toshiba Libretto device. wb(4) Winbond W83L518D Integrated Media Reader. wss(4) Windows Sound System-compatible sound cards ym(4) Yamaha OPL3-SA2 and OPL3-SA3 audio device driver. i386-dependent devices npx(4) i386 numeric processing extension coprocessor. pckbc(4) PC keyboard controllers. sony(4) Sony Miscellaneous Controller spic(4) Sony programmable I/O controller. DEBUGGING
Although the situation has become better over the years, ACPI is typically prone to various errors, ranging from blatant flaws in the firmware to bugs in the implementation. Before anything else, it is a good practice to upgrade the BIOS to the latest version available from the vendor. To ease the task of diagnosing and fixing different problems, the ACPICA reference implementation provides a rich facility of different debugging methods. In NetBSD these are generally only available if the kernel has been compiled with the ACPI_DEBUG option. Verbose messages The ACPIVERBOSE compile time option enables some verbose debug messages printed during the system startup. In a MODULAR (see options(4)) system, the information can be printed also at runtime, regardless of the presence of ACPIVERBOSE. To print the messages, modload(8) the acpiverbose module using the option -b dump=true. Custom DSDT ACPI interprets bytecode known as ACPI Machine Language (AML), provided by the BIOS as a memory image during the system bootstrap. Most of the AML relevant to acpi is implemented in the so-called Differentiated System Descriptor Table (DSDT). NetBSD provides support for overrid- ing the default DSDT supplied by the BIOS. The following steps can be used to override the DSDT: 1. Dump the raw DSDT with acpidump(8). 2. Disassemble the table with iasl(8). 3. Modify the disassembled table. 4. Compile the table with iasl(8) using the option -tc. 5. Either copy the (*.hex) file to src/sys/dev/acpi/acpica/Osd/custom_dsdt.hex or use the option ACPI_DSDT_FILE="/some/directory/custom_dsdt.hex" in the kernel configuration file. 6. Define ACPI_DSDT_OVERRIDE in the kernel configuration file and rebuild. Debugger The ACPICA interpreter provides its own debugger for low-level debugging. It can be used to display internal data structures and namespace objects, and to debug the execution of control methods. Single step and breakpoint functionality are available. In NetBSD this is inte- grated to the in-kernel ddb(4). In order to enter the ACPICA debugger from ddb(4), use the command call with the argument acpi_osd_debugger. Debug Output NetBSD provides three sysctl(8) variables that control the debug output at runtime. The hw.acpi.debug.layer variable limits the output to a specific ACPI layer and the hw.acpi.debug.level variable controls the debug level. Both sysctl(8) variables are string literals. The third variable is hw.acpi.debug.object. This is a boolean that controls whether debug messages internal to the AML are enabled. For the first two variables, the possible values are: LAYER LEVEL ACPI_DEBUG_NONE ACPI_DEBUG_NONE ACPI_UTILITIES ACPI_LV_INIT ACPI_HARDWARE ACPI_LV_DEBUG_OBJECT ACPI_EVENTS ACPI_LV_INFO ACPI_TABLES ACPI_LV_ALL_EXCEPTIONS * ACPI_NAMESPACE ACPI_PARSER ACPI_LV_INIT_NAMES ACPI_DISPATCHER ACPI_LV_PARSE ACPI_EXECUTER ACPI_LV_LOAD ACPI_RESOURCES ACPI_LV_DISPATCH ACPI_CA_DEBUGGER ACPI_LV_EXEC ACPI_OS_SERVICES ACPI_LV_NAMES ACPI_CA_DISASSEMBLER ACPI_LV_OPREGION ACPI_COMPILER ACPI_LV_BFIELD ACPI_TOOLS ACPI_LV_TABLES ACPI_EXAMPLE ACPI_LV_VALUES ACPI_DRIVER ACPI_LV_OBJECTS ACPI_ALL_COMPONENTS * ACPI_LV_RESOURCES ACPI_LV_USER_REQUESTS ACPI_BUS_COMPONENT ACPI_LV_PACKAGE ACPI_ACAD_COMPONENT ACPI_LV_VERBOSITY1 * ACPI_BAT_COMPONENT ACPI_BUTTON_COMPONENT ACPI_LV_ALLOCATIONS APCI_EC_COMPONENT ACPI_LV_FUNCTIONS ACPI_LID_COMPONENT ACPI_LV_OPTIMIZATIONS ACPI_RESOURCE_COMPONENT ACPI_LV_VERBOSITY2 * ACPI_TZ_COMPONENT ACPI_DISPLAY_COMPONENT ACPI_ALL_DRIVERS * ACPI_LV_MUTEX ACPI_LV_THREADS ACPI_LV_IO ACPI_LV_AML_INTERRUPTS * This is a compound ACPI_LV_VERBOSITY3 * constant, including all previous elements. ACPI_LV_AML_DISASSEMBLE ACPI_LV_VERBOSE_INFO ACPI_LV_FULL_TABLES ACPI_LV_EVENTS ACPI_LV_VERBOSE * In addition, there is ACPI_DEBUG_DEFAULT that is used by ACPICA as the default debug level. It includes ACPI_LV_INIT and ACPI_LV_DEBUG_OBJECT. The debug layer can be divided into two groups: the first one is specific to the ACPICA interpreter and the second one contains the internal ACPI components of NetBSD. The constant ACPI_ALL_DRIVERS includes all NetBSD specific parts. The ACPICA interpreter uses several debug levels internally, but the NetBSD specific parts are typically limited to ACPI_LV_DEBUG_OBJECT and ACPI_LV_INFO. The debug output can be stopped by setting hw.acpi.debug.level to ACPI_DEBUG_NONE. Example As an example, a driver may have defined the component it belongs to and the name of the module: #define _COMPONENT ACPI_BUS_COMPONENT ACPI_MODULE_NAME ("acpi_example") The driver may also utilize the debug facility: ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Failed to evaluate _STA ")); With these options the debug message from the ACPI_DEBUG_PRINT macro is only visible when hw.acpi.debug.layer is either ACPI_BUS_COMPONENT or a compound constant including it, and hw.acpi.debug.level is ACPI_LV_INFO or some constant that includes it. Finally, it can be noted that the ACPI implementation uses the prefix ACPI_DB, whereas the debug level sysctl(8) variable is always specified with the prefix ACPI_LV. Another example can be mentioned for the use of hw.acpi.debug.object. The following could appear in an ASL code: Method(_Q19, 0, NotSerialized) { Store("_Q19 invoked", Debug) Notify(ACAD, 0x80) } When hw.acpi.debug.object is set to 1, the message stored to the debug object is printed every time the method is called by the interpreter. SEE ALSO
ioapic(4), acpidump(8), amldb(8), iasl(8) Hewlett-Packard Corporation, Intel Corporation, Microsoft Corporation, Phoenix Technologies Ltd., and Toshiba Corporation, Advanced Configuration and Power Interface Specification, Revision 4.0, http://www.acpi.info/spec.htm, June 16, 2009. Intel Corporation, ACPI Component Architecture, Programmer Reference, OS-Independent Subsystem, Debugger, and Utilities, Revision 1.27, http://www.acpica.org/download/acpica-reference.pdf, January 20, 2010. Len Brown, ACPI in Linux - Myths vs. Reality, http://www.linuxsymposium.org/archives/OLS/Reprints-2007/brown_1-Reprint.pdf, 65-74, June 27-30, 2007, Proceedings of the Linux Symposium. Joerg Sonnenberger and Jared D. McNeill, Sleeping Beauty - NetBSD on Modern Laptops, http://2008.asiabsdcon.org/papers/P9A-paper.pdf, 127-134, February 3, 2008, Proceedings of AsiaBSDCon 2008. Takanori Watanabe, "ACPI Implementation on FreeBSD", Proceedings of the FREENIX Track: 2002 USENIX Annual Technical Conference, USENIX Association, http://www.usenix.org/event/usenix02/tech/freenix/full_papers/watanabe/watanabe.pdf, 121-131, June 10-15, 2002. HISTORY
The acpi driver appeared in NetBSD 1.6. AUTHORS
Authors of the acpi subsystem include Charles M. Hannum, Frank van der Linden, Jared D. McNeill, Jason R. Thorpe, Joerg Sonnenberger, and Jukka Ruohonen, among others. BUGS
Most of the ACPI power management functionalities are not implemented. BSD
October 5, 2011 BSD
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy