473,663 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

regarding unix specific commands

I dont know if this is the right place to ask this question.

i got this book "The C Odyssey. Unix - The Open, Boundless C"
It is a 1992 edition book

The book speaks of all the unix specific functions

Just quoting an example below:

void main()
{

int pid;
pid=getpid();
printf("Process id is \n",pid);

}

I would like to know if this should run on any linux flavour(since this
book talks only on unix/) with gcc compiler installed on it.What I
would like to know is if this book would prove useful to me if i would
like to play around with Linux.

Thanks in advance

Jan 1 '06 #1
9 2194
fidlee said:
I dont know if this is the right place to ask this question.

i got this book "The C Odyssey. Unix - The Open, Boundless C"
It is a 1992 edition book

The book speaks of all the unix specific functions

Just quoting an example below:

void main()


That's a bad sign. In C, main returns int, not void. There were a couple of
other problems with the code, too.

My own personal recommendations for Linux programming are "The Unix
Programming Environment" (Kernighan and Pike), "Linux Programming by
Example" by Kurt Wall, and "Advanced Programming in the Unix Environment"
(W Richard Stevens).

Probably in that order. And of course any other book by WRS, too.

But this newsgroup is about C, not about Unix or Linux, so I suggest you
seek further inspiration in comp.unix.progr ammer or
comp.os.linux.d evelopment.apps or something of that ilk, where you will get
much better answers to your Linux questions than you could possibly hope
for in this group.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 1 '06 #2
fidlee wrote:
I dont know if this is the right place to ask this question.

i got this book "The C Odyssey. Unix - The Open, Boundless C"
It is a 1992 edition book

The book speaks of all the unix specific functions

Just quoting an example below:

void main()

^^^^
You're dead already.
If this book really has main with a void return type, burn the book.
Quickly.
Jan 1 '06 #3
Martin Ambuhl said:
fidlee wrote:

void main()

^^^^
You're dead already.
If this book really has main with a void return type, burn the book.
Quickly.


Unless it's an intentional example of How Not To Write C. I am uncomfortably
aware that it is possible for advice along the lines of "DON'T DO THIS!" to
be read by some people as if it comprised not three words, but two. (I am
thinking particularly of the fflush(stdin) example in "C Unleashed".)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 1 '06 #4
Martin Ambuhl wrote:
fidlee wrote:
I dont know if this is the right place to ask this question.

i got this book "The C Odyssey. Unix - The Open, Boundless C"
It is a 1992 edition book

The book speaks of all the unix specific functions

Just quoting an example below:

void main()

^^^^
You're dead already.
If this book really has main with a void return type, burn the
book. Quickly.


I wonder if that could be an example of BullSchildt?

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
Jan 1 '06 #5
"fidlee" <fi****@gmail.c om> writes:
i got this book "The C Odyssey. Unix - The Open, Boundless C"
[...]
Just quoting an example below:

void main()


Burn it.

DES
--
Dag-Erling Smørgrav - de*@des.no
Jan 1 '06 #6
On 31 Dec 2005 21:51:38 -0800, fidlee wrote:

[getpid()]
I would like to know if this should run on any linux flavour(since this
book talks only on unix/) with gcc compiler installed on it.What I
would like to know is if this book would prove useful to me if i would
like to play around with Linux.


Do "man getpid" and you'll see that it conforms to posix, so
it should be widely available on linux systems. You can do
the same kind of check for any of the other functions you want
to use from that book. Reading the man page for functions
you're curious about is common sense on unix in any case.

This isn't topical here, but it's offered in the spirit of
"teach a man to fish ..."

--
"The secret of being boring is to say everything." - Voltaire
Jan 1 '06 #7

"Richard Heathfield" <in*****@invali d.invalid> wrote
Unless it's an intentional example of How Not To Write C. I am
uncomfortably
aware that it is possible for advice along the lines of "DON'T DO THIS!"
to
be read by some people as if it comprised not three words, but two. (I am
thinking particularly of the fflush(stdin) example in "C Unleashed".)

In English academic writing we use a star to represent illegal forms

e.g.

*English as she is spoke.

You need some silimar convention for C examples.
Jan 1 '06 #8


--
Pradyut
http://pradyut.tk
http://groups.yahoo.com/group/d_dom/
http://groups-beta.google.com/group/oop_programming
India
"fidlee" <fi****@gmail.c om> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I dont know if this is the right place to ask this question.

i got this book "The C Odyssey. Unix - The Open, Boundless C"
It is a 1992 edition book

The book speaks of all the unix specific functions

Just quoting an example below:

void main()
{

int pid;
pid=getpid();
printf("Process id is \n",pid);

} You missed %d in the line
printf("Process id is %d\n",pid);

And int main not void, with a return before ending the program

Whatever, if the book talks about gcc, gcc package remains the same,
whatever flavour u may be using for unix(or linux).
Ofcourse the path for the libraries and hardware interrupts may change

I would like to know if this should run on any linux flavour(since this
book talks only on unix/) with gcc compiler installed on it.What I
would like to know is if this book would prove useful to me if i would
like to play around with Linux.

Thanks in advance

Jan 2 '06 #9
Pradyut wrote:

Absolutely nothing, except a 66 line signature, which is
automatically discarded on reply by the better newsreaders.

In other words, a sig-line belongs at the end, after your comments,
which in turn may be either interspersed or after the *clipped*
material you quote.

Some newsreaders have (mistakenly) allowed a sig to be injected at
the head of quoted material. This option should *never* be used.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
Jan 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2996
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate Python scripts, where each one executes in it own thread of control. I would like to use a Unix command to get each script to run in its own shell. I have tried using the "Commands" module but after I issue the first "command", execution blocks...
3
2920
by: db2guy | last post by:
Hi Gurus, Questions for you. 1. Is it possible to assign a DB2 DBA for UNIX into a DB2 DBA for Mainframe (OS390)? 2. Are the data administration commands the same for UNIX and mainframe? 3. If not how many percent is the differecence?
3
5734
by: Fabian Knopf | last post by:
Hi friends, i have a unix machine PC1 where a database is running ( IBM DB2 V8.1 ) . Then i have another machine PC2 i installed there also ( IBM DB2 V8.1 ). On PC2 i installed unixODBC. To connect to the database over ODBC on unix i did this: on db2 console: catalog tcpip node archiv remote PC1 server DB2_db2inst1
9
8322
by: craig.overton | last post by:
All, I am currently developing an FTP class in VB.NET. It's kid tested, mother approved when trying to access an FTP Server on a Windows box meaning I can connect, run commands, upload and download a file no problem. My issues come when I try to use the same class with the same commands to access an FTP server on a UNIX box. I can connect and login just fine, but after that all my commands come back "500 'PWD': command not understood."....
8
2322
by: AG | last post by:
Hello, This is my first post to this group, and on top of that I am a beginner. So please direct me to another group if this post seems out of place.... I have recently written a program which calculates loan amortization schedules, writes the data to a text file, and then upon user prompt, the program will display the created file and print the file. Until this morning, everything worked fine, and then I started messing around with...
4
2358
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of which I mean here. Just for a moment, let's just take one definition for one of the
0
1478
by: Holly | last post by:
I copied this code that works to connect into Unix. I am looking for a way to get it to work with a secure Unix box. Anyone have any insights on how to do this? I am trying to build an sftp service. Thanks Holly Imports System Imports System.Net Imports System.IO
6
34084
by: marc | last post by:
hi im trying to convert Date() into a unix timestamp so i can stick the result into a mysql db, please help!
3
1344
by: Anand | last post by:
Dear All, I have to create one application software using VC++ for Windows socket. I have to use UDP protocol here. What can I do? If any body could guide us I would be pleased to them. Regards, E.Muruganandham
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.