01-10-2008
Quote:
Originally Posted by
DNAx86
Thank you, it works,
but can I do it in another way?
[ `cat file | wc -l` -gt 0 ] && echo "Not empty" || echo "empty"
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I understand that this version of Winzip allows 129-bit AES encryption and passwords. Can Solaris handle that yet? (2 Replies)
Discussion started by: BCarlson
2 Replies
2. Shell Programming and Scripting
Hi,
I had written an FTP script where in I loop through the directories and transfer the files from each and every directory of Windows to UNIX.
Now the problem is when
1. The connection is unable to be established I should return some error codes
2. When there is some system... (1 Reply)
Discussion started by: mahalakshmi
1 Replies
3. UNIX for Dummies Questions & Answers
I trying to search for lines with multiple search criterias in an archive of zipped files. But awk seems to have a limit.
Any idea how to fix it?
I'm on a sun solaris system.
Here is my search string:
gzcat -r *200808* | awk -v 'substr($0,50,11)=="11095512309" ||... (3 Replies)
Discussion started by: HugoH
3 Replies
4. UNIX for Dummies Questions & Answers
I am looking for a file with 'MCR0000000716214' in it. I tried the following command:
grep MCR0000000716214 *
The problem is that the folder I am searching in has over 87000 files and I am getting the following:
bash: /bin/grep: Arg list too long
Is there any command I can use that can... (6 Replies)
Discussion started by: runnerpaul
6 Replies
5. UNIX for Advanced & Expert Users
How you do usually deal with files in use during a backup?
Is there a option to let TAR skip opened files?
Or notify me an opened file is tar'ed?
What's the best practice?
Thanks (3 Replies)
Discussion started by: overmindxp
3 Replies
6. Shell Programming and Scripting
Hi,
I, have an output with 3 different values each below the other like:
# echo $bla
123
345
234
Each value is in one line and for the further processing I need every single value.
For example is there a way to grep line 2, like:
# echo $bla | grep --line 2
345
:)
Thank you in... (6 Replies)
Discussion started by: 2retti
6 Replies
7. UNIX for Dummies Questions & Answers
Hi people....
I have just started to learn unix.I want to know which version of Unix to install plus how to install it.I need to practise and make myself aware of how unix works.My thread is from an educational point of view.Also please feel free to give your suggestions as I am... (3 Replies)
Discussion started by: amit.kanade1983
3 Replies
8. UNIX for Dummies Questions & Answers
This question might be silly but its confusing me a bit:
What is the difference between handle to the thread HANDLE and thread identifier pthread_t?
---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ----------
Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies
9. Shell Programming and Scripting
Hello all,
I am working on a perl script which will read weblogic logfile and send the error messages to Zenoss Monitoring tool. At present the script works and it can able to send the error messages to Zenoss. The problem comes when the logrotate has been applied to the weblogic log file. At... (3 Replies)
Discussion started by: kar_333
3 Replies
10. Red Hat
i have windows 8 host on Dell Laptop
vmware 9
redhat 7.2 iso downloaded through redhat official site
after installation on vm it only boots into text dont show graphics
Please guide:( (1 Reply)
Discussion started by: hananabbas
1 Replies
LEARN ABOUT PHP
array_product
ARRAY_PRODUCT(3) 1 ARRAY_PRODUCT(3)
array_product - Calculate the product of values in an array
SYNOPSIS
number array_product (array $array)
DESCRIPTION
array_product(3) returns the product of values in an array.
PARAMETERS
o $array
- The array.
RETURN VALUES
Returns the product as an integer or float.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.6 | |
| | |
| | The product of an empty array is now 1, when |
| | before this function would return 0 for an empty |
| | array. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
array_product(3) examples
<?php
$a = array(2, 4, 6, 8);
echo "product(a) = " . array_product($a) . "
";
echo "product(array()) = " . array_product(array()) . "
";
?>
The above example will output:
product(a) = 384
product(array()) = 1
PHP Documentation Group ARRAY_PRODUCT(3)