Sponsored Content
Top Forums UNIX for Dummies Questions & Answers check for the first character to be blank Post 42108 by Optimus_P on Wednesday 22nd of October 2003 10:05:43 AM
Old 10-22-2003
Quote:
Originally posted by anthreedhr
Thanks oombera and optimus... Smilie both of the solutions each of you gave worked like a charm. I tried sometime similar to the end of the line as well.. with some mixed success.

Thanks again for your assistance.... and if you have any suggestions on how to get rid of the space at the end of the line, let me know. Harold
s/ *$//
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: How to check if field is blank?

In awk, I'd like to check if a field is blank. And by blank I mean, the field could be "" or " " In other words, the field could either be empty, or be filled with spaces. Would the regex look like this? $5 ~ // { Action }? What other ways are there? Hmm.. in any case I think... (7 Replies)
Discussion started by: yongho
7 Replies

2. AIX

How can i replace a character with blank space?

i want a command for my script!!! say file consists of character 123 125 127. i need a query to replace the number 2 with 0 so the output should be 103 105 107. i use unix-aix (8 Replies)
Discussion started by: rollthecoin
8 Replies

3. AIX

check for a particular character inside a file and substitute with a given character?

i am a newbie to shell script,so i want a kshell script in which i need to check for a particular character inside a file through conditional looping(like if ,case,while)and if that character exists ,then substitute a given character to that character. consider a file test.txt,inside the file... (1 Reply)
Discussion started by: karthikprasathk
1 Replies

4. Shell Programming and Scripting

how to check the variable values is blank

HI , I have to check the values of variable is blank or not. exm : ###test test1 var=`cate filename | head -1 | cut -c1-3` I need to check the first three character of 1st line . if it is blank .then exit or we need to process . Thanks in advance . (2 Replies)
Discussion started by: julirani
2 Replies

5. Shell Programming and Scripting

check if return value is blank

Hi, i am trying to get the no of users using nofActUsers=$(echo /usr/sbin/lsof -l | grep "/mast/data/users" ) it will return blank, if the user does nto have permissions to run the script. Now I need to check if the valueis blank i have route to another script else the user has to... (1 Reply)
Discussion started by: Satyak
1 Replies

6. Shell Programming and Scripting

how to replace a character with blank in a file

hi, I have a doubt in replacing characters with blank. My requirement is that, i have one file and looks like below 4:ALTER SYSTEM DISCONNECT SESSION '193,191' IMMEDIATE; 6:ALTER SYSTEM DISCONNECT SESSION '205,7274' IMMEDIATE; 5:ALTER SYSTEM DISCONNECT SESSION '206,34158' IMMEDIATE;... (4 Replies)
Discussion started by: sridhusha
4 Replies

7. UNIX for Advanced & Expert Users

check for users blank passwords

Hello, I have an AIX 5.3 system. I want to check users to see whether there are users with blank passwords but i would prefer to do that without checking /etc/passwd or /etc/security/passwd files. Also while i was searching the web for a solution i noticed that many people refer to /etc/shadow... (2 Replies)
Discussion started by: omonoiatis9
2 Replies

8. UNIX for Dummies Questions & Answers

Replace character by blank

Hi all, I have 89 columns,1200 rows in a flat file, some of the values are just '.' (the character dot). I want to replace them by nothing (blank), but when I do so, it affects the decimal numbers too. so 12.34 becomes 1234. How can I just replace values which are only '.' with 1 white... (13 Replies)
Discussion started by: newbie83
13 Replies

9. Shell Programming and Scripting

Remove blank space and insert special character

Hi Folks, I have a huge data of the below format abc #apple 1200 06/23 ghj #orange 1500 06/27 uyt #banana 2300 05/13 efg #vegetable 0700 04/16 After first 3 letters, i have 9 spaces and after fruit there are no specific fixed space, but it varies... (4 Replies)
Discussion started by: jayadanabalan
4 Replies

10. Shell Programming and Scripting

To check Blank Lines, Blank Records and Junk Characters in a File

Hi All Need Help I have a file with the below format (ABC.TXT) : ®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790 HDFLJDKJSKJ|KJALKSD02|M|7378439274898 KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999 (cont......) I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
Discussion started by: chatwithsaurav
6 Replies
BUS_ALLOC_RESOURCE(9)					   BSD Kernel Developer's Manual				     BUS_ALLOC_RESOURCE(9)

NAME
bus_alloc_resource, bus_alloc_resource_any -- allocate resources from a parent bus SYNOPSIS
#include <sys/param.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/rman.h> #include <machine/resource.h> struct resource * bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); struct resource * bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags); DESCRIPTION
This is an easy interface to the resource-management functions. It hides the indirection through the parent's method table. This function generally should be called in attach, but (except in some rare cases) never earlier. The bus_alloc_resource_any() function is a convenience wrapper for bus_alloc_resource(). It sets the values for start, end, and count to the default resource (see description of start below). The arguments are as follows: dev is the device that requests ownership of the resource. Before allocation, the resource is owned by the parent bus. type is the type of resource you want to allocate. It is one of: SYS_RES_IRQ for IRQs SYS_RES_DRQ for ISA DMA lines SYS_RES_IOPORT for I/O ports SYS_RES_MEMORY for I/O memory rid points to a bus specific handle that identifies the resource being allocated. For ISA this is an index into an array of resources that have been setup for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. For PCI, the offset into pci config space which has the BAR to use to access the resource. The bus methods are free to change the RIDs that they are given as a parameter. You must not depend on the value you gave it earlier. start and end are the start/end addresses of the resource. If you specify values of 0ul for start and ~0ul for end and 1 for count, the default values for the bus are calculated. count is the size of the resource. For example, the size of an I/O port is usually 1 byte (but some devices override this). If you speci- fied the default values for start and end, then the default value of the bus is used if count is smaller than the default value and count is used, if it is bigger than the default value. flags sets the flags for the resource. You can set one or more of these flags: RF_ALLOCATED resource has been reserved. The resource still needs to be activated with bus_activate_resource(9). RF_ACTIVE activate resource atomically. RF_SHAREABLE resource permits contemporaneous sharing. It should always be set unless you know that the resource cannot be shared. It is the bus driver's task to filter out the flag if the bus does not support sharing. For example, pccard(4) cannot share IRQs while cardbus(4) can. RF_TIMESHARE resource permits time-division sharing. RETURN VALUES
A pointer to struct resource is returned on success, a null pointer otherwise. EXAMPLES
This is some example code that allocates a 32 byte I/O port range and an IRQ. The values of portid and irqid should be saved in the softc of the device after these calls. struct resource *portres, *irqres; int portid, irqid; portid = 0; irqid = 0; portres = bus_alloc_resource(dev, SYS_RES_IOPORT, &portid, 0ul, ~0ul, 32, RF_ACTIVE); irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqid, RF_ACTIVE | RF_SHAREABLE); SEE ALSO
bus_activate_resource(9), bus_release_resource(9), device(9), driver(9) AUTHORS
This manual page was written by Alexander Langer <alex@big.endian.de> with parts by Warner Losh <imp@FreeBSD.org>. BSD
May 18, 2000 BSD
All times are GMT -4. The time now is 03:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy