Sponsored Content
Top Forums Shell Programming and Scripting Use one loop get the variable assignment Post 302747487 by MadeInGermany on Friday 21st of December 2012 12:15:07 PM
Old 12-21-2012
The previous post only works in ksh (last pipe element is in current context).
"eval" works in all sh derivates:
Code:
bus=slot=fuc=""
eval `
lspci -nn |
awk '
/8086:10a7/{split($1,a,"[:.]"); print "bus=0x"a[1],"slot=0x"a[2],"fuc=0x"a[3]}
'`

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

@ in a variable assignment

Hello Everybody, Does anyone know what the @ symbol means in a csh script, if used with a variable assignment as below @ line = 1 why not just use.... set line=1 Many thanks rkap (1 Reply)
Discussion started by: rkap
1 Replies

2. Shell Programming and Scripting

Variable assignment from a for loop values.

Guys I am trying to assignthe values to variables from a for loop. s1:/tmp> for i in `cat test` > do > echo $i > done Sdosanjh 2 6 Now, I want is NAME=Sdosanjh CURRENT=2 SPECIFIED=6 there are multiple lines in the "test" file. So next time when for loop picks values from next... (1 Reply)
Discussion started by: sdosanjh
1 Replies

3. Shell Programming and Scripting

eval and variable assignment

Hi, i have an issue with eval and variable assignment. 1) i have a date value in a variable and that date is part of a filename, var1=20100331 file1=${var1}-D1-0092.xml.zip file2=${var2}-D2-0092.xml.zip file3=${var3}-D3-0092.xml.zip i am passing the above variables to a script via... (11 Replies)
Discussion started by: mohanpadamata
11 Replies

4. Shell Programming and Scripting

substituted variable assignment

I try to run this script, however, it gives an exception in line 3. How do I do an assignment to a substituted variable? #!/bin/bash name=fruit ext_$(eval echo ${name})=apple tmp=ext_$(eval echo ${name}) if ]; then echo "apple" elif ]; then echo "orange" fi echo ${!tmp} Error... (2 Replies)
Discussion started by: angelokh
2 Replies

5. Shell Programming and Scripting

Help with variable assignment

Hi, In AIX I have a variable with , (coma) separated values assigned to it like shown below var1=apple,boy,chris i want to convert this to var1='apple','boy','chris' the number of values assigned to var1 might change and it could be from 1 to n any suggestions please? (3 Replies)
Discussion started by: rahul9909
3 Replies

6. Shell Programming and Scripting

Automatic variable assignment inside a for loop

cs1=`echo "scale=8;($css1/$css0)*100"|bc` cs2=`echo "scale=8;($css2/$css0)*100"|bc` cs3=`echo "scale=8;($css3/$css0)*100"|bc` cs4=`echo "scale=8;($css4/$css0)*100"|bc` cs5=`echo "scale=8;($css5/$css0)*100"|bc` cs6=`echo "scale=8;($css6/$css0)*100"|bc` cs7=`echo "scale=8;($css7/$css0)*100"|bc`... (3 Replies)
Discussion started by: thulasidharan2k
3 Replies

7. Shell Programming and Scripting

Complex variable assignment

Hi, I have a requirement as follows, need to call the format of ${$var} form. For example, i am taking a variable. count=1, ((LIMIT_$count=$count + 1)) Now i have to echo this variable LIMIT_$count. (This is in a loop..) echo ${LIMIT_$count} - displays as a syntax... (3 Replies)
Discussion started by: abhisheksunkari
3 Replies

8. Shell Programming and Scripting

'eval' used in variable assignment

pattern1=book { x=1 eval echo \$pattern$x } book (this is the output) But when I assign a variable to the output of the eval it doesn't work unless I prefix 2 times backslash before $ as shown below. { a=`eval echo \\$pattern$x` echo $a } book Why here twice "\" has to be... (3 Replies)
Discussion started by: ravisingh
3 Replies

9. Shell Programming and Scripting

Same Variable Assignment

Hi I have a strange problem: In my shell script I am performing a copy task: . prop.txt cp -r $dir/ $dir/archive $dir is fetched from a property file (prop.txt) which stores its value dir=/opt/data Now the problem is another dir1 comes into picture. I only want to add... (1 Reply)
Discussion started by: ankur328
1 Replies

10. Shell Programming and Scripting

Variable Assignment

Hi I am facing a problem. export local_folder=/opt/app/ cd /opt/app/abc/ abcversion="abc*" (abcga5 is inside /opt/app/abc/) echo $abcversion (it echoes the correct version as abcga5 ) Now when I reuse the value of abcversion for a below path: export... (6 Replies)
Discussion started by: ankur328
6 Replies
MCA(9)							   BSD Kernel Developer's Manual						    MCA(9)

NAME
MCA, mca_intr_establish, mca_intr_disestablish, mca_intr_evcnt, mca_conf_read, mca_conf_write -- MicroChannel Architecture bus SYNOPSIS
#include <sys/bus.h> #include <dev/mca/mcavar.h> #include <dev/mca/mcadevs.h> void * mca_intr_establish(mca_chipset_tag_t mc, mca_intr_handle_t hdl, int level, int (*handler)(void *), void *arg); void mca_intr_disestablish(mca_chipset_tag_t mc, mca_intr_handle_t hdl); const struct evcnt * mca_intr_evcnt(mca_chipset_tag_t mc, mca_intr_handle_t hdl); int mca_conf_read(mca_chipset_tag_t mc, int slot, int reg); void mca_conf_write(mca_chipset_tag_t mc, int slot, int reg, int data); DESCRIPTION
The MCA device provides support for IBM's MicroChannel Architecture bus found on IBM PS/2 systems and selected workstations. It was designed as a replacement bus for the ISA bus found on IBM's older machines. However, the bus specifications were only available under license, so MCA did not achieve widespread acceptance in the industry. Being a replacement for the ISA bus, the MCA bus does share some similar aspects with the ISA bus. Some MCA devices can be detected via the usual ISA-style probing. However, most device detection is done through the Programmable Option Select (POS) registers. These registers provide a window into a device to determine device-specific properties and configuration. The configuration of devices and their POS regis- ters is performed using IBM's system configuration software. The MCA bus uses level-triggered interrupts while the ISA bus uses edge-triggered interrupts. Level triggered interrupts have the advantage that they can be shared among multiple device. Therefore, most MCA-specific devices should be coded with shared interrupts in mind. DATA TYPES
Drivers for devices attached to the MCA bus will make use of the following data types: mca_chipset_tag_t Chipset tag for the MCA bus. mca_intr_handle_t The opaque handle describing an established interrupt handler. struct mca_attach_args A structure use to inform the driver of MCA bus properties. It contains the following members: bus_space_tag_t ma_iot; /* MCA I/O space tag */ bus_space_tag_t ma_memt; /* MCA mem space tag */ bus_dma_tag_t ma_dmat; /* MCA DMA tag */ int ma_slot; /* MCA slot number */ int ma_pos[8]; /* MCA POS values */ int ma_id; /* MCA device */ FUNCTIONS
mca_intr_establish(mc, hdl, level, handler, arg) Establish a MCA interrupt handler on the MCA bus specified by mc for the interrupt described completely by hdl. The priority of the interrupt is specified by level. When the interrupt occurs the function handler is called with argument arg. mca_intr_disestablish(mc, hdl) Dis-establish the interrupt handler on the MCA bus specified by mc for the interrupt described completely hdl. mca_intr_evcnt(mc, hdl) Do interrupt event counting on the MCA bus specified by mc for the event described completely by hdl. mca_conf_read(mc, slot, reg) Read the POS register reg for the device in slot slot on the MCA bus specified by mc. mca_conf_write(mc, slot, reg, data) Write data data to the POS register reg for the device in slot slot on the MCA bus specified by mc. AUTOCONFIGURATION
The MCA bus is a direct-connection bus. During autoconfiguration, the parent specifies the MCA device ID for the found device in the ma_id member of the mca_attach_args structure. Drivers should match on the device ID. Device capabilities and configuration information should be read from device POS registers using mca_conf_read(). Some important configuration information found in the POS registers include the I/O base address, memory base address and interrupt number. The location of these configurable options with the POS registers are device spe- cific. DMA SUPPORT
The MCA bus supports 32-bit, bidirectional DMA transfers. Currently, no machine-independent support for MCA DMA is available. CODE REFERENCES
The MCA subsystem itself is implemented within the file sys/dev/mca/mca_subr.c. Machine-dependent portions can be found in sys/arch/<arch>/mca/mca_machdep.c. The database of known devices exists within the file sys/dev/mca/mcadevs_data.h and is generated automat- ically from the file sys/dev/mca/mcadevs. New vendor and product identifiers should be added to this file. The database can be regenerated using the Makefile sys/dev/mca/Makefile.mcadevs. A good source of information about MCA devices is IBM's system configuration disk. The disk contains .adf files which describe the location of device configuration options in the POS registers. SEE ALSO
mca(4), autoconf(9), bus_dma(9), bus_space(9), driver(9), isa(9) BUGS
The machine-independent MCA driver does not currently support DMA. MCA devices which require DMA operation currently access the DMA capabil- ities directly. BSD
October 7, 2001 BSD
All times are GMT -4. The time now is 05:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy