Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mike Release the "nsh" command under the CDDL

6 views
Skip to first unread message

Mike Cox

unread,
Mar 3, 2005, 12:04:05 AM3/3/05
to
I am announcing the release of the "nsh" command (pronounced "New Shell").
This innovative command will make system administration easier by allowing
the admin to navigate to different locations by creating new shells. You
can store up to 26 of your favorite locations and recall them in new shells.
When you are done working in that directory, just close the shell and you
will be back to your old one! Since I'm leaving usenet in April, I will be
maintaining the command on my website located here:
http://www.geocities.com/mikecoxlinux/

This command released under the SUN created CDDL license will give
OpenSolaris a competitive edge over linux. With DTrace, and now "nsh", the
exodus from linux may be rapid. Without much further ado, here is the "nsh"
command:


/*
AUTHOR: Mike Cox.
EMAIL: mikeco...@yahoo.com
WEB: www.geocities.com/mikecoxlinux/
COPYRIGHT: (C) 2005 Mike Cox. All Rights Reserved.
VERSION: Version 1.0

******** THE "nsh" [pronounced "New Shell"] COMMAND ********
LICENSE: "nsh" is released under the CDDL License.

WARRANTY: This program is provided AS IS. There is NO
warranty for this software program. The Author
assumes NO responsiblity for the usablity of this
software. Use at your own risk.

FEATURES: 0: Creates a new shell with the user's home directory.
1: Allows user to store directories in 26 buffers.
2: Allows user to create new shells to directories in those buffers.
3: Allows user to list contents of the current directory.
4: Allows user to list contents of directories in the 26 buffers.
5: Allows user to specify directory for nsh to list the contents of.

EXAMPLES:
0: linux:/usr/local/# nsh
1: linux:/usr/local/doc/# nsh -s a
-or-
linux:/home/user# nsh -s a /usr/local/share/doc/
2: linux:/home/user# nsh -r a
3: linux:/home/user# nsh -l
4: linux:/home/user# nsh -l a
5: linux:/home/user# nsh -l /usr/local/share/doc/

COMPILE: "nsh" can be compiled using this command:
g++ -o nsh nsh.cpp

INSTALL: Move the "nsh" program to:
/usr/local/bin/
*/
#include <iostream>
#include <pwd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <vector>

using std::vector;

void recall_path(int argc, char** argv);
void set_path(int argc, char** argv);
void write_path(char* nsh_path, char nsh_buf);
void list_contents(int argc, char** argv);
void create_nsh();

int main(int argc, char** argv)
{

if(argc > 1){
if(strcmp(argv[1], "-r") == 0){
recall_path(argc, argv);
}else if(strcmp(argv[1], "-s") == 0){
set_path(argc, argv);
}else if(strcmp(argv[1], "-l") == 0){
list_contents(argc, argv);
}else{
std::cout<<"Error: "<<<" is not a supported option.\n";
}
}
//Going home.
else{
create_nsh();
}
return 0;
}
void recall_path(int argc, char** argv)
{
/* Get the user .nsh file. */
uid_t nsh_usr;
struct passwd* nsh_ps;

nsh_usr = getuid();
nsh_ps = getpwuid(nsh_usr);

if(!nsh_ps){
std::cout<<"Error: Set Path Failed.\n ";
exit(1);
}
char* nsh_name = new char[strlen(nsh_ps->pw_dir) + 5];
strcpy(nsh_name, nsh_ps->pw_dir);
strcat(nsh_name,"/.nsh");
/* Read file and find buffer. Execute corrosponding path*/
FILE* o;
o = fopen(nsh_name,"r");
fseek();
fclose(o);
delete [] nsh_name;
}
void set_path(int argc, char** argv)
{

/*
Makes sure the user has specified an alpha buffer.
Then writes the current directory or a user specified one to the buffer.
*/
if(argc < 3){
std::cout<<"Error: Need to specify a buffer. Lower case [a-z] are valid.
\n";
exit(1);
}
if(islower(argv[2][0])){
if(argc == 3){
write_path(get_current_dir_name(),argv[2][0]);
}else if(argv[3][0] == '/'){
write_path(argv[3], argv[2][0]);
}else{
std::cout<<"Error: Not a valid directory name.\n";
}
}else{
for(int i = 0; i < argc; ++i){
std::cout<< argv[i];
std::cout<<" ";
}
std::cout<<"Error: Need to specify a buffer. Lower case [a-z] are valid.
\n";

}

}
void write_path(char* nsh_path, char nsh_buf )
{

uid_t nsh_usr;
struct passwd* nsh_ps;

nsh_usr = getuid();
nsh_ps = getpwuid(nsh_usr);

if(!nsh_ps){
std::cout<<"Error: Set Path Failed.\n ";
exit(1);
}
char* nsh_name = new char[strlen(nsh_ps->pw_dir) + 5];
strcpy(nsh_name, nsh_ps->pw_dir);
strcat(nsh_name,"/.nsh");

FILE* o;
o =fopen(nsh_name, "a");

char* b = new char[2];
strcpy(b,nsh_buf);

fputs(b, o);
fputs(" ", o);
fputs(nsh_path, o);
fputs("\n", o);
/* close file and delete memory */
fclose(o);
delete [] b;
delete [] nsh_name;
}
void list_contents(int argc, char** argv)
{
/*
For right now, it just lists the current dir contents.
Soon, you will be able to list contents in buffer directories.
*/
system("ls -la");
}
void create_nsh()
{

uid_t nsh_usr;
struct passwd* nsh_ps;

nsh_usr = getuid();
nsh_ps = getpwuid(nsh_usr);

if(!nsh_ps){
std::cout<<"Error: Create New Shell Failed. \n ";
exit(1);
}
chdir(nsh_ps->pw_dir);
execl(nsh_ps->pw_shell,nsh_ps->pw_shell,(const char*) NULL);

}

The Ghost In The Machine

unread,
Mar 3, 2005, 4:00:03 PM3/3/05
to
You know, most people decide to embarrass themselves in private.
Nevertheless, a critique is most probably in order here, so
I'll continue...

In comp.os.linux.advocacy, Mike Cox
<mikeco...@yahoo.com>
wrote
on Wed, 2 Mar 2005 21:04:05 -0800
<38nk80F...@individual.net>:


> I am announcing the release of the "nsh" command (pronounced "New Shell").
> This innovative command will make system administration easier by allowing
> the admin to navigate to different locations by creating new shells. You
> can store up to 26 of your favorite locations and recall them in new shells.
> When you are done working in that directory, just close the shell and you
> will be back to your old one! Since I'm leaving usenet in April, I will be
> maintaining the command on my website located here:
> http://www.geocities.com/mikecoxlinux/

There's a credibility magnet.

>
> This command released under the SUN created CDDL license will give
> OpenSolaris a competitive edge over linux. With DTrace, and now "nsh", the
> exodus from linux may be rapid.

To where? Solaris?

> Without much further ado, here is the "nsh" command:

adb, actually. And you're probably going to need it... :-)

(For those on the Linux side, 'adb' is a fairly primitive but
useful debugger, long since replaced here by 'gdb'. One
might also use 'gdb' on Solaris, if one uses 'g++' thereon.
I don't know what other debuggers Solaris has.)

So far, the usual crap.

>
> using std::vector;

std::vector is used nowhere else in the program. If you're going
to do this, you might want to:

#include <vector>
#include <string>
using std::vector;
using std::string;

and then actually use the types vector and string. You might
also want to throw in a

#include <map>
using std::map;

if you're familiar with std::map<>; I for one find it very useful.

>
> void recall_path(int argc, char** argv);
> void set_path(int argc, char** argv);
> void write_path(char* nsh_path, char nsh_buf);
> void list_contents(int argc, char** argv);
> void create_nsh();

I'm not horribly fond of forward declarations, but that I might
wave off as a usage issue. A more serious problem is
whether one should redeclare these using signatures such
as

void do_something(std::vector<string> const & arglist);

since that would be more in line with C++/STL, as opposed to
the quaint, archaic argc/argv pair. (argc = arglist.size();
argv[i] = arglist[i] in STL.)

Then again, argc/argv is slightly faster.

>
> int main(int argc, char** argv)
> {

A proper declaration; good.

>
> if(argc > 1){

man getopt. Please. Now.

> if(strcmp(argv[1], "-r") == 0){
> recall_path(argc, argv);
> }else if(strcmp(argv[1], "-s") == 0){
> set_path(argc, argv);
> }else if(strcmp(argv[1], "-l") == 0){
> list_contents(argc, argv);
> }else{
> std::cout<<"Error: "<<<" is not a supported option.\n";

The argv[1] probably got lost somewhere in translation, but you'll have
to rewrite this whole section anyway if you're going to use getopt.

A good delegation of code here.

> }
> }
> //Going home.
> else{
> create_nsh();

In light of your implementation below this could be slightly problematic
if the sysadmin actually sets the shell in /etc/passwd to be
/usr/local/bin/nsh, which will create an infinite loop. I'm
not entirely sure if that was one of your intentions.

> }
> return 0;

A proper termination. Good.

> }
> void recall_path(int argc, char** argv)
> {
> /* Get the user .nsh file. */
> uid_t nsh_usr;
> struct passwd* nsh_ps;
>
> nsh_usr = getuid();
> nsh_ps = getpwuid(nsh_usr);
>
> if(!nsh_ps){
> std::cout<<"Error: Set Path Failed.\n ";
> exit(1);
> }

man perror/syserror/errno. Also, that trailing space will
result in some very minor confusion.

> char* nsh_name = new char[strlen(nsh_ps->pw_dir) + 5];

You really need to study #include <string> and use it
instead of such kludginess. Also, you need to use
6 instead of 5 here. I've worked on a project that
got bitten very hard because strings didn't allocate
room for the terminating '\0'. Very obscure!

> strcpy(nsh_name, nsh_ps->pw_dir);
> strcat(nsh_name,"/.nsh");

"/.nsh" is 5 characters. That plus 1 (for the terminating \0)
means 6.

> /* Read file and find buffer. Execute corrosponding path*/
> FILE* o;

This is C++. Why use Portable I/O here? Study std::fstream,
for example.

> o = fopen(nsh_name,"r");

A check for NULL is highly recommended here.

> fseek();

Man fseek. Now.

> fclose(o);
> delete [] nsh_name;

Congratulations. Now, erm, precisely what was this function
supposed to do again? Apart from checking for the user
and the existence of his home directory, this function does
exactly nothing. (I'll give you brownie points for cleaning
up your misallocated string but that's about it.)

> }
> void set_path(int argc, char** argv)
> {
>
> /*
> Makes sure the user has specified an alpha buffer.
> Then writes the current directory or a user specified
> one to the buffer.
> */
> if(argc < 3){
> std::cout<<"Error: Need to specify a buffer. Lower case \
> [a-z] are valid. \n";
> exit(1);
> }
> if(islower(argv[2][0])){

I'll admit to wondering why you limit yourself so. #include <map>
and just shove argv[2] thereinto (after converting it to a std::string,
of course). This way one can have millions of buffers -- not just 26.

I'm not horribly thrilled about your argpassing conventions, either;
ideally main() would have passed

set_path(argc-1, argv+1)

which means argv[0] in set_path() would actually be the "-s". Less
chance of error if code moves around later; most people know
about argv[0] being the program name or subname.

> if(argc == 3){
> write_path(get_current_dir_name(),argv[2][0]);

get_current_dir_name() is a GNU extension. man getcwd().

> }else if(argv[3][0] == '/'){
> write_path(argv[3], argv[2][0]);
> }else{
> std::cout<<"Error: Not a valid directory name.\n";

One might want to combine the results of getcwd(), "/", and
argv[3] here; also, checking for the existence of a file
is helpful.

> }
> }else{
> for(int i = 0; i < argc; ++i){
> std::cout<< argv[i];
> std::cout<<" ";
> }
> std::cout<<"Error: Need to specify a buffer. \
> Lower case [a-z] are valid. \n";

Again, you limit yourself. Also, you're going to get diagnostics
such as

$ nsh -r X /home/mikecox/workarea/something
-r X /home/mikecox/workarea/something Error: Need to specify a buffer...

so you'll either want to put a newline in there or redo this bit.

>
> }
>
> }
> void write_path(char* nsh_path, char nsh_buf )
> {
>
> uid_t nsh_usr;
> struct passwd* nsh_ps;
>
> nsh_usr = getuid();
> nsh_ps = getpwuid(nsh_usr);
>
> if(!nsh_ps){
> std::cout<<"Error: Set Path Failed.\n ";
> exit(1);
> }

Perhaps you could put this code in a single routine and call it, maybe,

struct passwd * get_user_passwd();

?

> char* nsh_name = new char[strlen(nsh_ps->pw_dir) + 5];
> strcpy(nsh_name, nsh_ps->pw_dir);
> strcat(nsh_name,"/.nsh");

This code has the same error as above, and might similarly
be refactored:

char * get_nsh_path();

>
> FILE* o;
> o =fopen(nsh_name, "a");
>
> char* b = new char[2];
> strcpy(b,nsh_buf);

Eek. Better replace this strcpy() pronto with

b[0] = nsh_buf;
b[1] = '\0';

Otherwise, you'll probably crash out with a core dump. Also,
perhaps 'nsh_buf' should be renamed?

As it is, the 'new' is largely unnecessary; simply use putc() instead,
below.

>
> fputs(b, o);
> fputs(" ", o);
> fputs(nsh_path, o);
> fputs("\n", o);

A little clumsy, but workable for the most part. However,
there's a serious design flaw here; you'll want to create
a new file and rewrite all of your buffers, then rename it.
The append used here will work after a fashion but the
file will grow without bound.

This also could use more error checking.

> /* close file and delete memory */
> fclose(o);
> delete [] b;
> delete [] nsh_name;

Kudos for cleaning up, but that *was* a bit of a mess.

> }
> void list_contents(int argc, char** argv)
> {
> /*
> For right now, it just lists the current dir contents.
> Soon, you will be able to list contents in buffer directories.
> */

I'll assume a char * dir is computed somewhere in here, for clarity.

> system("ls -la");

Hm. You'll probably want to keep an in-memory copy of ~/.nsh.
Also, building the system() takes some care mostly because
of stupid stuff the shell does. It might be simpler to
simply fork() and execl():

pid_t kid = fork();
if(kid == 0)
{
execlp("ls", "ls", "-la", "--", dir, (char *) NULL);
perror("Eeek, my execlp() failed");
exit(-1);
}
else
{
int stat;
int ret = waitpid(kid, &stat, 0);
}

as opposed to mucking about with things like

system ("ls -la -- 'This can'\''t be elegantly handled'");

Fortunately, ls has the '--' option, so that filenames such as
'-abc' don't confuse the heck out of it.

> }
> void create_nsh()
> {
>
> uid_t nsh_usr;
> struct passwd* nsh_ps;
>
> nsh_usr = getuid();
> nsh_ps = getpwuid(nsh_usr);
>
> if(!nsh_ps){
> std::cout<<"Error: Create New Shell Failed. \n ";
> exit(1);
> }

Now where have I seen this code before...?

> chdir(nsh_ps->pw_dir);
> execl(nsh_ps->pw_shell,nsh_ps->pw_shell,(const char*) NULL);

Interesting, but what exactly are you doing here? This doesn't
create a new shell, merely replaces your executable with
whatever shell the sysadmin has specified in /etc/passwd for
that user. Closing the shell will log out the user.

One might contemplate doing something like this in recall_path(),
but it's an absolutely awful hack, and highly disruptive if
nsh ever wants to use local variables, as nsh will have to
carefully save them just before it reloads itself.

>
> }
>

All in all, this functionality is probably better implemented
using aliases in bash.

--
#191, ewi...@earthlink.net
It's still legal to go .sigless.

B Gruff

unread,
Mar 3, 2005, 5:31:56 PM3/3/05
to
On Thursday 03 March 2005 21:00 The Ghost In The Machine wrote:

>
> (For those on the Linux side, 'adb' is a fairly primitive but
> useful debugger, long since replaced here by 'gdb'.  One
> might also use 'gdb' on Solaris, if one uses 'g++' thereon.
> I don't know what other debuggers Solaris has.)

You may not, my good sir, but we do know de buggers in this group, and
M.Cox is one of them!
He says he will be leaving usenet in April.
He will, of course, be doing no such thing. He will simply be
changing his name and moving his NG account, because de bugger is too
tight to cough-up 10 Euros a month to keep the one he's using!

Bill

B Gruff

unread,
Mar 3, 2005, 6:01:34 PM3/3/05
to
On Thursday 03 March 2005 22:31 B Gruff wrote:

> He will, of course, be doing no such thing.  He will simply be
> changing his name and moving his NG account, because de bugger is
> too tight to cough-up 10 Euros a month to keep the one he's using!

- and before that gives him a fit, it's actually 10 Euro a year, of
course!

Roy Culley

unread,
Mar 3, 2005, 7:46:17 PM3/3/05
to
begin risky.vbs
<38nk80F...@individual.net>,

"Mike Cox" <mikeco...@yahoo.com> writes:
>
> I am announcing the release of the "nsh" command (pronounced "New
> Shell"). This innovative command will make system administration
> easier by allowing the admin to navigate to different locations by
> creating new shells. You can store up to 26 of your favorite
> locations and recall them in new shells. When you are done working
> in that directory, just close the shell and you will be back to your
> old one! Since I'm leaving usenet in April, I will be maintaining
> the command on my website located here:
> http://www.geocities.com/mikecoxlinux/

man bash

Keywords: pushd, popd, dirs, alias

Mark Kent

unread,
Mar 4, 2005, 6:37:46 AM3/4/05
to
Roy Culley <r...@nodomain.none> espoused:

Condemned to reinvent forever...

--
| Mark Kent -- mark at ellandroad dot demon dot co dot uk |
<LIM> mmmm, multitextured donuts....
<knghtbrd> LIM: with fruit filling?
<LIM> knghtbrd: chocolate cream...

Mike Cox

unread,
Mar 4, 2005, 1:07:08 PM3/4/05
to

"The Ghost In The Machine" <ew...@sirius.athghost7038suus.net> wrote in
message news:e89kf2-...@sirius.athghost7038suus.net...

<snip code nitpicking>

This is a good reason why one should never release open source code. Look
at how many people start nitpicking code. Can't you just be happy you got a
free command? Why be such snobs and nitpick every single thing in something
you got for free? And BTW, the only reason I didn't allocate enough space
for /.nsh file was because it was just a search and replace from /.hm. As
you can see, /.hm had 5 chars in it including the terminating character.
Since vim is a stupid command, it cannot tell me that in a critical area
such as memory allocation, my new string was longer.

Alan Coopersmith

unread,
Mar 4, 2005, 1:27:07 PM3/4/05
to
The Ghost In The Machine <ew...@sirius.athghost7038suus.net> writes in comp.unix.solaris:

|adb, actually. And you're probably going to need it... :-)
|
|(For those on the Linux side, 'adb' is a fairly primitive but
|useful debugger, long since replaced here by 'gdb'. One
|might also use 'gdb' on Solaris, if one uses 'g++' thereon.
|I don't know what other debuggers Solaris has.)

adb has been replaced by the more modern "Modular Debugger" mdb - the
command lives on, but executes mdb in an adb compatibility mode. It's
still a different style of debugging than gdb - much more focused on
post-mortem debugging than interactive, and includes kmdb, a variant for
debugging the kernel.

For those looking for something similar to gdb, dbx is included with the
Sun compilers and has a very similar usage style (I believe gdb was
originally intended to be the GNU version of the original dbx, but both
gdb and dbx have gained a lot since then).

--
________________________________________________________________________
Alan Coopersmith * al...@alum.calberkeley.org * Alan.Coo...@Sun.COM
http://www.csua.berkeley.edu/~alanc/ * http://blogs.sun.com/alanc/
Working for, but definitely not speaking for, Sun Microsystems, Inc.

B Gruff

unread,
Mar 4, 2005, 1:38:42 PM3/4/05
to
On Friday 04 March 2005 18:07 Mike Cox wrote:

> This is a good reason why one should never release open source code.
>  Look at how many people start nitpicking code.  Can't you just be
> happy you got a free command?  Why be such snobs and nitpick every
> single thing in something you got for free?  And BTW, the only
> reason I didn't allocate enough space for /.nsh file was because it
> was just a search and replace from /.hm.  As you can see, /.hm had 5
> chars in it including the terminating character. Since vim is a
> stupid command, it cannot tell me that in a critical area such as
> memory allocation, my new string was longer.

I tell you, I think I'm the only one to find these things funny!

Somebody talk to him about peer review, and the disadvantages of NOT
releasing the code?

Bill

Richard Santink

unread,
Mar 4, 2005, 3:21:40 PM3/4/05
to

>
> <snip code nitpicking>
>
> This is a good reason why one should never release open source code. Look
> at how many people start nitpicking code. Can't you just be happy you got a
> free command? Why be such snobs and nitpick every single thing in something
> you got for free? And BTW, the only reason I didn't allocate enough space
> for /.nsh file was because it was just a search and replace from /.hm. As
> you can see, /.hm had 5 chars in it including the terminating character.
> Since vim is a stupid command, it cannot tell me that in a critical area
> such as memory allocation, my new string was longer.
>


I went to your website and reloaded a bunch of times, just to increment
your counter for you... ;)

BTW, I fail to find the "Operating Systems, Technology Research and
Reviews" that you mention on your site. Also, I don't think you need a
TOC when you have a single item...


RAS


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Stefaan A Eeckels

unread,
Mar 4, 2005, 4:44:49 PM3/4/05
to
On Fri, 4 Mar 2005 10:07:08 -0800
"Mike Cox" <mikeco...@yahoo.com> wrote:

> This is a good reason why one

Yup, you're the _one_ who should never release any code,
open or closed.

> should never release open source code. Look at how many people start
> nitpicking code. Can't you just be happy you got a free command?

But after your fanfare and hype, what did you expect?
Your puny program isn't going to cause a single "defection"
from Linux, as you were trumpetting. When people see a hot
air balloon tooting its own horn, their natural tendency is
to try and puncture it. Be happy you got good, constructive
criticsm, and learn from the experience.

> Why be such snobs and nitpick every single thing in something you got for
> free? And BTW, the only reason I didn't allocate enough space for /.nsh file
> was because it was just a search and replace from /.hm. As you can see, /.hm
> had 5 chars in it including the terminating character. Since vim is a stupid
> command, it cannot tell me that in a critical area such as memory allocation,
> my new string was longer.

At least, vim works as advertised, something that cannot be
said from your brain farts. Vim's an editor, bonehead, not an
IDE (which, 'C' being what it is, would have had a hard time
stopping you from overrunning your buffers anyway).

--
Stefaan
--
As complexity rises, precise statements lose meaning,
and meaningful statements lose precision. -- Lotfi Zadeh

The Ghost In The Machine

unread,
Mar 4, 2005, 5:00:03 PM3/4/05
to
In comp.os.linux.advocacy, Mike Cox
<mikeco...@yahoo.com>
wrote
on Fri, 4 Mar 2005 10:07:08 -0800
<38rmg9F...@individual.net>:

The ultimate nitpicker is the computer itself. One wrong bit can
spell disaster in the machine code.

> Look at how many people start nitpicking code. Can't you just be
> happy you got a free command?

Which doesn't work?

> Why be such snobs and nitpick every single thing in something
> you got for free?

Does that include viruses, trojans, and other such malware?
After all, they're free -- and largely uncontrolled, in the wild.

> And BTW, the only reason I didn't allocate enough space
> for /.nsh file was because it was just a search and replace
> from /.hm.

One of the risks of that sort of coding, methinks.

> As you can see, /.hm had 5 chars in it including the terminating character.
> Since vim is a stupid command, it cannot tell me that in a critical area
> such as memory allocation, my new string was longer.
>

Ah yes. So Emacs would have caught this error, then?

An interesting notion, but it's barely possible.

Mike Cox

unread,
Mar 4, 2005, 5:59:50 PM3/4/05
to

"The Ghost In The Machine" <ew...@sirius.athghost7038suus.net> wrote in
message news:e89kf2-...@sirius.athghost7038suus.net...

> > void recall_path(int argc, char** argv);


> > void set_path(int argc, char** argv);
> > void write_path(char* nsh_path, char nsh_buf);
> > void list_contents(int argc, char** argv);
> > void create_nsh();
>
> I'm not horribly fond of forward declarations, but that I might
> wave off as a usage issue. A more serious problem is
> whether one should redeclare these using signatures such
> as
>
> void do_something(std::vector<string> const & arglist);
>

Well, forward declarations are required! Function declarations are required
for it to even compile. I don't know what standards book or compiler you
are using, but I think the fine folks at comp.lang.c++ will be able to set
you straight.


palowoda

unread,
Mar 5, 2005, 7:16:00 AM3/5/05
to
The Cox program could be tweated. Long live BIFF.
What the hell ever happened to Jesus.


---Bob

Roy Culley

unread,
Mar 5, 2005, 11:02:15 AM3/5/05
to
begin risky.vbs
<38rmg9F...@individual.net>,

"Mike Cox" <mikeco...@yahoo.com> writes:
>
> And BTW, the only reason I didn't allocate enough space for /.nsh
> file was because it was just a search and replace from /.hm. As you
> can see, /.hm had 5 chars in it including the terminating character.

But Mike, didn't you say in another thread that you didn't post the
h[o]m[e] articles but a forger did? Don't tell me you were lying yet
again?

Rich Teer

unread,
Mar 5, 2005, 1:45:50 PM3/5/05
to
On Sat, 5 Mar 2005, palowoda wrote:

> What the hell ever happened to Jesus.

He's got industrial disease...

--
Rich Teer, SCNA, SCSA

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich

Josip Gracin

unread,
Mar 5, 2005, 3:48:06 PM3/5/05
to
Rich Teer wrote:
> On Sat, 5 Mar 2005, palowoda wrote:
>> What the hell ever happened to Jesus.
> He's got industrial disease...

How come Jesus got industrial disease?

palowoda

unread,
Mar 6, 2005, 1:54:29 AM3/6/05
to
It was more like a mutation gone haywire. It was fixed in
another name.

---Bob

Paul Floyd

unread,
Mar 6, 2005, 1:47:01 PM3/6/05
to
On Thu, 03 Mar 2005 21:00:03 GMT, The Ghost In The Machine
<ew...@sirius.athghost7038suus.net> wrote:

>> }else if(argv[3][0] == '/'){
>> write_path(argv[3], argv[2][0]);
>> }else{
>> std::cout<<"Error: Not a valid directory name.\n";
>
> One might want to combine the results of getcwd(), "/", and
> argv[3] here; also, checking for the existence of a file
> is helpful.

And perhaps a bit of ::realpath() as well.

A bientot
Paul
--
Paul Floyd http://paulf.free.fr (for what it's worth)
Surgery: ennobled Gerald.

Rich Teer

unread,
Mar 6, 2005, 2:18:21 PM3/6/05
to
On Sat, 5 Mar 2005, Josip Gracin wrote:

> How come Jesus got industrial disease?

Well, you see, there's actually two man claiming to be Jesus.
One of them was talking about aboloshing Monday mornings and
Friday afternoons, while the other one (the one we're talking
about) decided to go on hunger strike. Apparently he's dying
by degrees...

Josip Gracin

unread,
Mar 6, 2005, 3:02:14 PM3/6/05
to
Rich Teer wrote:
> Well, you see, there's actually two man claiming to be Jesus.
> One of them was talking about aboloshing Monday mornings and
> Friday afternoons, while the other one (the one we're talking
> about) decided to go on hunger strike. Apparently he's dying
> by degrees...

Maybe they should both see Doctor Parkinson.

Johannes Bauer

unread,
Mar 6, 2005, 8:16:56 PM3/6/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefaan A Eeckels wrote:
>>Since vim is a stupid
>>command, it cannot tell me that in a critical area such as memory allocation,
>>my new string was longer.
>
> At least, vim works as advertised, something that cannot be
> said from your brain farts. Vim's an editor, bonehead, not an
> IDE (which, 'C' being what it is, would have had a hard time
> stopping you from overrunning your buffers anyway).

I was writing a document in Microsoft Word. It was titled "Construction
of modulo remainder class principal ideal domains using the Chinese
remainder theorem". Instead, I wrote that I like fish for supper and
that I find trees beautiful.

Believe it or not, Word didn't notice! Duh!!! It was, like, a completely
different topic! Word is such a stupid command, it cannot tell me that
in a critial area such as not digressing, I was totally digressing.

And that happens with a application that some people actually PAY for.

Greetings,
Johannes

- --
PLEASE verify my signature. Some forging troll is claiming to be me.
My GPG key id is 0xCC727E2E (dated 2004-11-03). You can get it from
wwwkeys.pgp.net or random.sks.keyserver.penguin.de.
Also: Messages from "Comcast Online" are ALWAYS forged.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCK6uICseFG8xyfi4RAjW5AJ9c/iyze54R/FmqKnfdKsLGYkuJcQCdEXNQ
7TU5ptAeZEUdax8PRbxKygs=
=p6IM
-----END PGP SIGNATURE-----

Grant

unread,
Mar 6, 2005, 8:57:29 PM3/6/05
to
Thanks for the shell, Mike ;)

Grant

Joerg Schilling

unread,
Mar 7, 2005, 7:11:22 AM3/7/05
to
In article <Pine.SOL.4.58.05...@zen.rite-group.com>,

Rich Teer <rich...@rite-group.com> wrote:
>On Sat, 5 Mar 2005, Josip Gracin wrote:
>
>> How come Jesus got industrial disease?
>
>Well, you see, there's actually two man claiming to be Jesus.

If you go to a nuthouse and ask the staff for manic depressive
people who are just in their manic phase, you probably will find
a lot of "Jesus" people.

Napoleon has become a bit out of fashion these days :-)

--
EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
j...@cs.tu-berlin.de (uni)
schi...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily

The Ghost In The Machine

unread,
Mar 7, 2005, 1:00:06 PM3/7/05
to
In comp.os.linux.advocacy, Paul Floyd
<ro...@127.0.0.1>
wrote
on 6 Mar 2005 18:47:01 GMT
<slrnd2mk6...@bisanne.netpratique.fr>:

> On Thu, 03 Mar 2005 21:00:03 GMT, The Ghost In The Machine
> <ew...@sirius.athghost7038suus.net> wrote:
>
>>> }else if(argv[3][0] == '/'){
>>> write_path(argv[3], argv[2][0]);
>>> }else{
>>> std::cout<<"Error: Not a valid directory name.\n";
>>
>> One might want to combine the results of getcwd(), "/", and
>> argv[3] here; also, checking for the existence of a file
>> is helpful.
>
> And perhaps a bit of ::realpath() as well.

Hmm...can't say I've seen that one before (in Unix, anyway;
Aegis had 'name_$resolve()'). Cool. :-)

>
> A bientot
> Paul

0 new messages