Sponsored Content
Full Discussion: getting filesize
Top Forums Shell Programming and Scripting getting filesize Post 302210157 by pppswing on Monday 30th of June 2008 08:09:54 AM
Old 06-30-2008
Nop, I don't have perl

I have an error not a valid identifier but I have the good result in it.

set $bibi=`ls -lk myfile | awk '{print $5}'`

bash : error `21 not a valid identifier,
21 is the size of the file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filesize

I know in php if you use the function filesize it will return the size of the file in bytes, but is there an easy way to get the size in MB. Cheers (2 Replies)
Discussion started by: jmg5
2 Replies

2. Shell Programming and Scripting

FileSize ???

How do I identify if there is any content in a file? If there is nothing in a specified file, I'd like to send an email indicating that there is nothing to report. Any help appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. UNIX for Dummies Questions & Answers

Sorting ls by filesize

I saw some stuff in the search results on this - but nothing specific..... I have a significant number of files (c. 300) which are output from a large process that I run. These are compared with a 'baselined' set of files - so I can quickly see if there are differences based on the sizes of the... (2 Replies)
Discussion started by: peter.herlihy
2 Replies

4. Shell Programming and Scripting

How to truncate as filesize?

Hello everybody it's me again. I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence? in the process are an... (1 Reply)
Discussion started by: Lestat
1 Replies

5. HP-UX

Increasing Filesize on HP-UX UNIX

Dear sir My hp-ux OS version is 11i (11.23) , and Oracle DB is 9i (9.2.0.6) the problem that I can't create any file (DB datafile , export Dump file , Rman backup pices.... etc) under the OS biger than 2 GB and the csh % limit check is %limit cputime unlimited filesize ... (4 Replies)
Discussion started by: ae_nassar
4 Replies

6. UNIX for Dummies Questions & Answers

UNIX and filesize

Hey guys. What I need to do is this: I need to find files that have a certain filesize (for this case a file size of 0 (zero) ) When I find this file with a filesize of zero I need to echo a statement that tells the user to delete it and not to delete it if the filesize is greater than... (3 Replies)
Discussion started by: ndoggy020
3 Replies

7. Shell Programming and Scripting

filesize

I want to know if there is any unix command to view the size of the file? eg. i have a directory letter in this i have file a,b,c,d,e. i just want to know the size of file d and not any other. (3 Replies)
Discussion started by: infyanurag
3 Replies

8. Shell Programming and Scripting

Filesize not working

I am having problems with finding the filesize with this in my script: filesize=`ls -l | awk '$5=0'` if ; then ls -l | awk '{print $9 " " $5}' if ; then echo "Would you like to delete this file? (y/n)" if yes do this elif no do this fi fi else... (7 Replies)
Discussion started by: akeenabawa
7 Replies

9. AIX

listing the whole system by filesize

Hi, Just wondered what command you would use to list all the files on Aix by filesize? I've tried a few but none of which seem to do the trick! Currently running du -m -a . | sort -rn | more as root Thanks, Matt. (1 Reply)
Discussion started by: elmesy
1 Replies

10. Shell Programming and Scripting

if condition for filesize

Hi, I want to check file size in unix, based on file size I am going to execute appropriate command. I tried below, but getting the error. System details – Machine hardware: sun4u OS version: 5.9 if ( -s $f1 ) then echo "filename exists and is > 0 bytes" else echo "filename... (7 Replies)
Discussion started by: rahulbahulekar
7 Replies
LDAP_SEARCH(3)								 1							    LDAP_SEARCH(3)

ldap_search - Search LDAP tree

SYNOPSIS
resource ldap_search (resource $link_identifier, string $base_dn, string $filter, [array $attributes], [int $attrsonly], [int $size- limit], [int $timelimit], [int $deref]) DESCRIPTION
Performs the search for a specified filter on the directory with the scope of LDAP_SCOPE_SUBTREE. This is equivalent to searching the entire directory. From 4.0.5 on it's also possible to do parallel searches. To do this you use an array of link identifiers, rather than a single identi- fier, as the first argument. If you don't want the same base DN and the same filter for all the searches, you can also use an array of base DNs and/or an array of filters. Those arrays must be of the same size as the link identifier array since the first entries of the arrays are used for one search, the second entries are used for another, and so on. When doing parallel searches an array of search result identi- fiers is returned, except in case of error, then the entry corresponding to the search will be FALSE. This is very much like the value nor- mally returned, except that a result identifier is always returned when a search was made. There are some rare cases where the normal search returns FALSE while the parallel search returns an identifier. PARAMETERS
o $link_identifier - An LDAP link identifier, returned by ldap_connect(3). o $base_dn - The base DN for the directory. o $filter - The search filter can be simple or advanced, using boolean operators in the format described in the LDAP documentation (see the Netscape Directory SDK for full information on filters). o $attributes - An array of the required attributes, e.g. array("mail", "sn", "cn"). Note that the "dn" is always returned irrespective of which attributes types are requested. Using this parameter is much more efficient than the default action (which is to return all attributes and their associated values). The use of this parameter should therefore be considered good practice. o $attrsonly - Should be set to 1 if only attribute types are wanted. If set to 0 both attributes types and attribute values are fetched which is the default behaviour. o $sizelimit - Enables you to limit the count of entries fetched. Setting this to 0 means no limit. Note This parameter can NOT override server-side preset sizelimit. You can set it lower though. Some directory server hosts will be configured to return no more than a preset number of entries. If this occurs, the server will indicate that it has only returned a partial results set. This also occurs if you use this parameter to limit the count of fetched entries. o $timelimit - Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. Note This parameter can NOT override server-side preset timelimit. You can set it lower though. o $deref - Specifies how aliases should be handled during the search. It can be one of the following: o LDAP_DEREF_NEVER - (default) aliases are never dereferenced. o LDAP_DEREF_SEARCHING - aliases should be dereferenced during the search but not when locating the base object of the search. o LDAP_DEREF_FINDING - aliases should be dereferenced when locating the base object but not during the search. o LDAP_DEREF_ALWAYS - aliases should be dereferenced always. RETURN VALUES
Returns a search result identifier or FALSE on error. EXAMPLES
The example below retrieves the organizational unit, surname, given name and email address for all people in "My Company" where the sur- name or given name contains the substring $person. This example uses a boolean filter to tell the server to look for information in more than one attribute. Example #1 LDAP search <?php // $ds is a valid link identifier for a directory server // $person is all or part of a person's name, eg "Jo" $dn = "o=My Company, c=US"; $filter="(|(sn=$person*)(givenname=$person*))"; $justthese = array("ou", "sn", "givenname", "mail"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); echo $info["count"]." entries returned "; ?> PHP Documentation Group LDAP_SEARCH(3)
All times are GMT -4. The time now is 06:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy