10 More Discussions You Might Find Interesting
1. Programming
H friends,
As we know, a function returns a value and that value is saved somwhere. like
int Sum( int x, int y )
{
return x + y;
}
Total = Sum( 10, 20 );
The value 30 is saved in variable Total.
Now the question is, what int value does the function main return, and where is it... (5 Replies)
Discussion started by: gabam
5 Replies
2. Programming
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 Replies)
Discussion started by: sehang
3 Replies
3. Shell Programming and Scripting
Hello, I have the below perl function int to return the integer value from the expression but it is not. I am not sure if something misses out here. Any help on this? Thanks in advance.
# Code sample Start
my $size = int (`1134 sample_text_here`);
print "$size \n";
# Code end
----------... (0 Replies)
Discussion started by: nmattam
0 Replies
4. Shell Programming and Scripting
I created two functions that output two random variables. I want to output them in the output file. But it does not seem to work.
# Function rgaussian1(r1, r2)
# Gaussian random number generator
function rgaussian1(r1, r2) {
pi = 3.142
v1 = sqrt( -2 * log(rand()) )
v2... (18 Replies)
Discussion started by: kristinu
18 Replies
5. Shell Programming and Scripting
Hi,
I am having issue with awk command . This command is running in the command prompt but inside a shell script.
awk -F'| ' 'int($1)==$1 && int($3) ==$3' int_check.txt
$cat int_check.txt
123|abc|123x
234|def|345
When i run it inside a shell script i am getting the error
"bailing... (5 Replies)
Discussion started by: ashwin3086
5 Replies
6. Shell Programming and Scripting
Hi, I have a file like this
SPF_HC00001|iCalcular_Monto_Minimo|--->|SPF_HC00028|pstcObtener_Monto_Minimo
SPF_HC00004|iCalcular_Incrementos|--->|SPF_HC00032|pstcObtener_Num_Incrementos
SPF_HC00005|iCalcular_Articulo_167_Reformado|--->|SPF_HC00031|pstcObtener_Por_CB_Inc... (2 Replies)
Discussion started by: kcoder24
2 Replies
7. UNIX for Advanced & Expert Users
I need to detect the number of pages in a print job when it is available so I can warn users when they try to print a report much larger than they expected. Sometimes they are trying to print 1000 page reports when they thought they were getting a 10 page report.
Under linux I am scanning the... (5 Replies)
Discussion started by: Max Rebo
5 Replies
8. Shell Programming and Scripting
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies
9. Shell Programming and Scripting
#!/bin/bash
awk '
function ad(t,r){
return (t+r);
}
BEGIN{
print ad(5,3);
}
{
print ad(5,3);
}
'
Doesn't print anything for the last print ad(5,3); (6 Replies)
Discussion started by: cola
6 Replies
10. UNIX for Dummies Questions & Answers
hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies