Sponsored Content
Homework and Emergencies Homework & Coursework Questions String editing using sed? awk? Post 302370571 by daptal on Wednesday 11th of November 2009 10:20:30 PM
Old 11-11-2009
Assume users are in a file named users

Code:
for user in `cat users`; do echo $user; done

replace echo $user with the functionality you intend

HTH,
PL
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Editing File using awk/sed

Hello Awk Gurus, Can anyone of you help me with the below problem. I have got a file having data in below format pmFaultyTransportBlocks ----------------------- 9842993 pmFrmNoOfDiscRachFrames ----------------------- NULL pmNoRecRandomAccSuccess -----------------------... (4 Replies)
Discussion started by: Mohammed
4 Replies

2. Shell Programming and Scripting

awk/sed - getting string instead of number

Hi! I am writing a script handling downloading list of files and I have to check whether file is present locally and if not finished than continue downloading. To do so I have to compare sizes of remote file and local file. To check remote file size I have to parse something like this: ... (2 Replies)
Discussion started by: hrwath
2 Replies

3. Shell Programming and Scripting

sed or awk editing help

Hi all I use aix (sadly). I've got a file consisting of fields separated by commas, I need a sed or awk command that will delete all spaces between two commas as long as there are only spaces between the commas. eg ,abc, ,sd , ,dr at would become ,abc,,sd ,,dr at I have... (53 Replies)
Discussion started by: mychmose
53 Replies

4. Shell Programming and Scripting

Line/Variable Editing for Awk sed Cut

Hello, i have a file, i open the file and read the line, i want to get the first item in the csv file and also teh third+6 item and wirte it to a new csv file. only problem is that using echo it takes TOO LONG: please help a newbie. below is my code: WorkingDir=$1 FileName=`cut -d ',' -f... (2 Replies)
Discussion started by: limamichelle
2 Replies

5. Shell Programming and Scripting

match string exactly with awk/sed

Hi all, I have a list that I would like to parse with awk/sed. The list is contains entries such as: JournalTitle: Biochemistry JournalTitle: Biochemistry and cell biology = Biochimie et biologie cellulaire JournalTitle: Biochemistry and experimental biology JournalTitle: Biochemistry and... (6 Replies)
Discussion started by: euval
6 Replies

6. Shell Programming and Scripting

editing file with awk cut and sed

HI All, I am new to unix. I have a file would like to do some editing by using awk, cut and sed. Could anyone help? This file contain 100 lines. There are one line for example: 2,"102343454",5060,"579668","579668","579668","SIP",,,"825922","035885221283026",1,268,"00:59:00.782 APR 17... (2 Replies)
Discussion started by: mimilaw
2 Replies

7. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

8. Shell Programming and Scripting

sed awk to remove the , in a string

Dear All, Can anyone help to remove the , bewteen "" in a string by using sed or awk? e.g. input : 1,4,5,"abcdef","we,are,here",4,"help hep" output:1,4,5,"abcdef","wearehere",4,"help hep" Thanks, Mimi (5 Replies)
Discussion started by: mimilaw
5 Replies

9. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

10. Shell Programming and Scripting

Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: --> cat comp.pkglist Package list: nss-util-devel-3.28.4-1.el6_9.x86_64 Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
IMAP_GET_QUOTA(3)							 1							 IMAP_GET_QUOTA(3)

imap_get_quota - Retrieve the quota level settings, and usage statics per mailbox

SYNOPSIS
array imap_get_quota (resource $imap_stream, string $quota_root) DESCRIPTION
Retrieve the quota level settings, and usage statics per mailbox. For a non-admin user version of this function, please see the imap_get_quotaroot(3) function of PHP. PARAMETERS
o $ imap_stream -An IMAP stream returned by imap_open(3). o $quota_root -$quota_root should normally be in the form of user.name where name is the mailbox you wish to retrieve information about. RETURN VALUES
Returns an array with integer values limit and usage for the given mailbox. The value of limit represents the total amount of space allowed for this mailbox. The usage value represents the mailboxes current level of capacity. Will return FALSE in the case of failure. As of PHP 4.3, the function more properly reflects the functionality as dictated by the RFC2087. The array return value has changed to support an unlimited number of returned resources (i.e. messages, or sub-folders) with each named resource receiving an individual array key. Each key value then contains an another array with the usage and limit values within it. For backwards compatibility reasons, the original access methods are still available for use, although it is suggested to update. EXAMPLES
Example #1 imap_get_quota(3) example <?php $mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN) or die("can't connect: " . imap_last_error()); $quota_value = imap_get_quota($mbox, "user.kalowsky"); if (is_array($quota_value)) { echo "Usage level is: " . $quota_value['usage']; echo "Limit level is: " . $quota_value['limit']; } imap_close($mbox); ?> Example #2 imap_get_quota(3) 4.3 or greater example <?php $mbox = imap_open("{imap.example.org}", "mailadmin", "password", OP_HALFOPEN) or die("can't connect: " . imap_last_error()); $quota_values = imap_get_quota($mbox, "user.kalowsky"); if (is_array($quota_values)) { $storage = $quota_values['STORAGE']; echo "STORAGE usage level is: " . $storage['usage']; echo "STORAGE limit level is: " . $storage['limit']; $message = $quota_values['MESSAGE']; echo "MESSAGE usage level is: " . $message['usage']; echo "MESSAGE limit is: " . $message['limit']; /* ... */ } imap_close($mbox); ?> NOTES
This function is currently only available to users of the c-client2000 or greater library. The given $imap_stream must be opened as the mail administrator, otherwise this function will fail. SEE ALSO
imap_open(3), imap_set_quota(3), imap_get_quotaroot(3). PHP Documentation Group IMAP_GET_QUOTA(3)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy