Sponsored Content
Top Forums Programming how to capture OS name using C/C++ code Post 302358257 by Gunther on Thursday 1st of October 2009 08:44:28 PM
Old 10-01-2009
Ok, so here's the source:
Code:
#include <stdio.h>
#include <sys/utsname.h>
#include <stdlib.h>

int main()
{
	struct utsname name;
	if(uname(&name)) exit(-1);
	printf("Your computer's OS is %s@%s\n", name.sysname, name.release);
	return 0;
}

So should I forward my bank connection to you?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture Oracle return code in shell script

I am using the following code in my shell script list=`sqlplus -s $user/$pwd@$dbms<<EOF WHENEVER SQLERROR EXIT SQL.SQLCODE set pagesize 0 feedback off verify off heading off echo off select * from control_tbl where src_nm=$3 and extrct_nm=$4; exit SQL.SQLCODE; EOF` ERROR=$?... (1 Reply)
Discussion started by: Vikas Sood
1 Replies

2. Shell Programming and Scripting

capture ftp return code..PLZ HELP

Hi all, i have written a code to ftp a file from one server to other.The ftp is happeneing successfully,but i am not able to capture the return code,to check if ftp has failed. plz help me to find out the return code....this is urgent below is the code i have written... (3 Replies)
Discussion started by: anju
3 Replies

3. Shell Programming and Scripting

How to capture status code and echo a message

Im trying to execute application and its return code is below IF Status code=o echo "........" else Staus Code =-2 DJRE then echo "......" Can any one help me how to handle the status code and echo some message. (12 Replies)
Discussion started by: laknar
12 Replies

4. UNIX for Dummies Questions & Answers

How to capture exit code for a bg job

If I execute a job in background (in ksh or bash), how would I capture the exit code for that job? Thanks, - CB (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

5. Shell Programming and Scripting

Capture http response code from wget

Hi All, I am using wget to call a url..i am getting 202 if it is successful. if not i am forcing the response code to 417. how can i capture the response code and print 0 if it is 202 and 1 if it is not 202 any ideas, please share Thanks, Jack. (2 Replies)
Discussion started by: jack3698
2 Replies

6. Shell Programming and Scripting

Comparing files and capture return code

Hi, I would like to compare 2 files, and have a return code write to a file. regardless of the files contents are the same the code should be writing to a file (if both files contents are same then return code 0). A simple example will be great :) Thanks (3 Replies)
Discussion started by: khchong
3 Replies

7. Shell Programming and Scripting

How to capture script return code?

Hi I am executing database backup via shell script (Korn). The backup log is long, but I would like to capture only the last line so I can send an email if it fails Example of failed backup (only last 3 lines) BR0056I End of database backup: bejbofoh.aff 2012-07-26 07.31.21 BR0280I... (7 Replies)
Discussion started by: nimo
7 Replies

8. Shell Programming and Scripting

How to capture exit code of child script and send it to parent script?

#!/usr/local/bin/bash set -vx /prod/HotelierLinks/palaceLink/bin/PalacefilesWait /prod/HotelierLinks/palaceLink/bin/prodEnvSetup 03212013 & if then echo "fatal error: Palace/HardRock failed!!!!" 1>&2 echo "Palace Failed" | mail -s "Link Failed at Palace/HardRock" -c... (1 Reply)
Discussion started by: aroragaurav.84
1 Replies

9. Shell Programming and Scripting

How to capture 3 digit return code of ftp??

is it possible to capture the 3 digit return code of ftp commands in a local variable inside a shell script? Code: ftp remoteserver << EOFTP quote USER uid quote PASS pass prompt cd remote_directory mput file.txt bye EOFTP in the above script, if cd ... (4 Replies)
Discussion started by: Little
4 Replies

10. Shell Programming and Scripting

Script to retry FTP commands if unsuccessful and capture the failure status code.

I am using the below code to ftp file onto another server FTP_LOG_FILE=${CURR_PRG_NAME}- ${FTP_FILE}-`date +%Y%m%d%H%M%S`.log ftp -ivn ${FTP_HOST} ${FTP_PORT} << ENDFTP >> ${EDI_LOG_DIR}/${FTP_LOG_FILE} 2>&1 user ${FTP_USER} ${FTP_PSWD} lcd... (2 Replies)
Discussion started by: akashdeepak
2 Replies
OHCOUNT(1)							   User Commands							OHCOUNT(1)

NAME
ohcount - manual page for ohcount 3.0.0 SYNOPSIS
ohcount [option] [paths...] DESCRIPTION
Ohloh source code line counter command line tool. http://www.ohloh.net/ [option] can be one of the following: -a, --annotate -d, --detect -h, --help -i, --individual -l, --license -re -s, --summary -a, --annotate Show annotated source code The contents of all source code files found within the given paths will be emitted to stdout. Each line will be prefixed with a tab-delimited language name and semantic categorization (code, comment, or blank). -d, --detect Find source code files Recursively find all source code files within the given paths. For each source code file found, the file name will be emitted to stdout prefixed with a tab-delimited language name. -h, --help Display this message -i, --individual Count lines of code per file Count lines in all source code files within the given paths, and emit a report of the lines of code, comments, and blanks in each language per file. -l, --license Displays detected licensing information contained in each source code file. -re Prints raw entity information to the screen (mainly for debugging). -s, --summary Count lines of code (default) Count lines in all source code files within the given paths, and emit a report of the total number of lines of code, comments, and blanks in each language. This is the default action. [paths] can refer to any number of individual files or directories. Directories will be probed recursively. If no path is given, the current directory will be used. ohcount 3.0.0 September 2011 OHCOUNT(1)
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy