10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
`awk` function looks like this in a file name `fun.awk`:
{
print small()
}
function small()
{
a=$0
smal=0
for(i=1;i<=3;i++)
{
if( a<a)
smal=a
else (4 Replies)
Discussion started by: lazerz
4 Replies
2. Shell Programming and Scripting
I have a lines like below, captured from rrdtool fetch command,
1395295200 2.0629986254e+06 7.4634784967e+05
1395297000 2.0198121616e+06 6.8658888903e+05
1395298800 1.8787141122e+06 6.7482866452e+05
1395300600 1.7586118678e+06 6.7867977653e+05
1395302400 1.8222762151e+06 7.1301678859e+05I'm... (3 Replies)
Discussion started by: rk4k
3 Replies
3. Shell Programming and Scripting
# cat t.txt
2,3,4,5,A,2012-01-01 00:00:28
2,6,4,5,A,2012-01-02 00:00:28
2,7,4,5,A,2012-01-02 02:00:28
# awk -F"," '{OFS=",";print $2,"";printf("%s", strftime("%m%d%y",$6));printf("%s", strftime("%H%M%S \n",$6));print ("",$1)}' t.txt
3,
010170073332
,2
6,
010170073332
,2
7,... (3 Replies)
Discussion started by: before4
3 Replies
4. Shell Programming and Scripting
hallow all i need your advice about this script
i have script like this:
INDEX=/zpool1/NFS/INDEX/${1}
SCRIPT=/zpool1/NFS/script/${1}
LIST=SAMPLE
cd ${SCRIPT}
for i in `cat ${LIST}`
do
GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'`
/usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (4 Replies)
Discussion started by: zvtral
4 Replies
5. Programming
Hi friends,
Hope everyone is doing well. Please have a look at this simple program, you will figure out what I want.
#include <stdio.h>
int main()
{
printf("Enter an integer!\n");
scanf( "%d", 134511890 ); // Valid address on my computer
printf( "%d\n", ???? );
return 0;
}
... (3 Replies)
Discussion started by: gabam
3 Replies
6. UNIX for Dummies Questions & Answers
#include<stdio.h>
int counter;
int fibonacci(int n)
{
counter += 1;
if ( n <= 2 )
return 1;
else
return fibonacci(n-1) + fibonacci(n-2);
}
int main(void)
{
int i;
int sum ;
for( i = 1 ; i<= 10; i++)
{
counter = 0;
sum... (1 Reply)
Discussion started by: vincent__tse
1 Replies
7. Shell Programming and Scripting
I want to print a string say "str1 str2 str3 str4" using printf.
If I try printing it using printf it is printing as follows.
output
-------
str1
str2
str3
str4
btw I'm working in AIX.
This is my first post in this forum :)
regards,
rakesh (4 Replies)
Discussion started by: enigmatrix
4 Replies
8. Programming
hey all, im a new programmer.
i was wondering how you would go about writing the printf function yourself? it is my understanding that when you call printf you are calling an already written function and just providing an argument? if this is the case, is it possible to write that function... (8 Replies)
Discussion started by: Christian.B
8 Replies
9. 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
10. Programming
I use FreeBSD,and use signal,like follows:
signal(SIGHUP,sig_hup);
signal(SIGIO,sig_io);
when I run call following code,it can run,but I find a puzzled question,it should print some information,such as printf("execute main()") will print execute main(),but in fact,printf fuction print... (2 Replies)
Discussion started by: konvalo
2 Replies