Hey All,
I'm trying to clean up a variable using sed but It dosn't seem to work. I'm trying to find all the spaces and replace them with "\ " (a slash and a space). For Example "Hello World" should become "Hello\ World". But it does nothing. If I put it directly into the command line it works... (3 Replies)
Hi everyone,
I have a simple question to ask :
In a script that I'm writting, I need to create variables on-the-fly.
For instance, for every iterartion of the following loop a var_X variable should be generated :
#!/bin/ksh
a="1 2 3"
for i in $a
do
var_${i}=$i
echo "${var_$i}"
done
... (1 Reply)
I have run into a wall with my iptables firewall scripting.
I am blocking all of the private side IP addresses on the
WAN interface on systems running NAT. However, if the
system is not running NAT and needs to allow access to
the local LAN on the WAN interface, I need to block all
but one of... (2 Replies)
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
Hi,
That might be pretty simple.
How can I generate a variable name and get their value ?
Thanks a lot.
Something like:
>CUSTOMER_NF=26
> object=CUSTOMER
> echo ${object}_NF
CUSTOMER_NF
> echo ${${object}_NF}
ksh: ${${object}_NF}: 0403-011 The specified substitution is... (7 Replies)
file1.ksh
#!/bin/ksh
test5_create="I am a man" # test5 will be dynamic and the value will be passed from command line
a=${1}_create
echo $a # i need the output as "I am a man"
./file1.ksh test5 # i run the script like this
any suggessions guys... (1 Reply)
Hi ,
I have a variable as follows,
Temp=`cat ABC.txt | cut -c5-`
This will yeild a part of the date. say , 200912.
I would like to substitute this variable's value in a filename.
eg: File200912F.zip
when i say File$TempF.zip , it is not substituting.
Any help ?
Thanks in... (2 Replies)
For example I have variable like below
echo $OUTPUT
/some/path/`uname -n`
when I try to use the variable OUTPUT like below
cd $OUTPUT or cd ${OUTPUT}
I am getting bad substituion error message
$ cd $OUTPUT
ksh: cd: bad substitution
$ cd ${OUTPUT}
ksh: cd: bad substitution
... (1 Reply)
Hi,
I have to write a shell script in which I have to substitute a variable within a variable. For example,
var1=aaa
var2=file.$var1.txt
The output should be,
echo $var2
file.aaa.txt
Can someone please help me in getting this. I tried using eval, but it didnt work. I might be using it... (2 Replies)
HI
i was studying about variable substitution. below are info which was given in a online tutorial.
${parameter:-word}---> If parameter is null or unset, word is substituted for parameter.
The value of parameter does not change.
${parameter:=word}---> If parameter is null or... (3 Replies)
Discussion started by: scriptor
3 Replies
LEARN ABOUT SUNOS
csx_parse_cistpl_devicegeo_a
csx_Parse_CISTPL_DEVICEGEO_A(9F) Kernel Functions for Drivers csx_Parse_CISTPL_DEVICEGEO_A(9F)NAME
csx_Parse_CISTPL_DEVICEGEO_A - parse the Device Geo A tuple
SYNOPSIS
#include <sys/pccard.h>
int32_t csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t ch, tuple_t *tp, cistpl_devicegeo_t *pt);
INTERFACE LEVEL
Solaris DDI Specific (Solaris DDI)
PARAMETERS
ch Client handle returned from csx_RegisterClient(9F).
tp Pointer to a tuple_t structure (see tuple(9S)) returned by a call to csx_GetFirstTuple(9F) or csx_GetNextTuple(9F).
pt Pointer to a cistpl_devicegeo_t structure which contains the parsed Device Geo A tuple information upon return from this function.
DESCRIPTION
This function parses the Device Geo A tuple, CISTPL_DEVICEGEO_A, into a form usable by PC Card drivers.
The CISTPL_DEVICEGEO_A tuple describes the device geometry of attribute memory partitions.
STRUCTURE MEMBERS
The structure members of cistpl_devicegeo_t are:
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus;
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs;
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs;
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs;
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].part;
uint32_t info[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil;
The fields are defined as follows:
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus
This field indicates the card interface width in bytes for the given partition.
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs
This field indicates the minimum erase block size for the given partition.
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs
This field indicates the minimum read block size for the given partition.
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs
This field indicates the minimum write block size for the given partition.
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].part
This field indicates the segment partition subdivisions for the given partition.
info[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil
This field indicates the hardware interleave for the given partition.
RETURN VALUES
CS_SUCCESS Successful operation.
CS_BAD_HANDLE Client handle is invalid.
CS_UNKNOWN_TUPLE Parser does not know how to parse tuple.
CS_NO_CARD No PC Card in socket.
CS_NO_CIS No Card Information Structure (CIS) on PC Card.
CS_UNSUPPORTED_FUNCTION No PCMCIA hardware installed.
CONTEXT
This function may be called from user or kernel context.
SEE ALSO csx_GetFirstTuple(9F), csx_GetNextTuple(9F), csx_GetTupleData(9F), csx_Parse_CISTPL_DEVICEGEO(9F), csx_RegisterClient(9F), tuple(9S)
PC Card 95 Standard, PCMCIA/JEIDA
SunOS 5.10 16 May 1997 csx_Parse_CISTPL_DEVICEGEO_A(9F)