Web Bilder Videos Maps News Groups Google Mail Mehr »
Kürzlich besuchte Gruppen | Hilfe | Anmelden
Google Groups-Startseite
Mike releases the "home" command under the GPL
Gegenwärtig gibt es mehrere Themen in dieser Gruppe, die zuerst angezeigt werden sollen. Damit dieses Thema zuerst angezeigt werden kann, muss diese Option bei einem anderen Thema entfernt werden.
Bei der Bearbeitung Ihrer Anfrage ist ein Fehler aufgetreten. Versuchen Sie es erneut.
Kennzeichnen
  Nachrichten 1 - 25 von 48 - Alle ausblenden  -  Alles übersetzen in die Sprache: Übersetzt (alle Originale anzeigen)   Neuere >
Bei der Gruppe, für die Sie eine Mitteilung verfassen, handelt es sich um eine Usenet-Gruppe. Wenn Sie in dieser Gruppe Nachrichten posten, ist Ihre E-Mail-Adresse für jeden im Internet sichtbar
Ihre Antwort wurde nicht gesendet.
Die Nachricht wurde übermittelt.
 
Von:
An:
Cc:
Nachtrag zu:
Cc hinzufügen | Nachtrag hinzufügen zu | Betreff bearbeiten
Betreff:
Bestätigung:
Geben Sie zur Bestätigung die im folgenden Bild angezeigten Zeichen oder die durchgesagten Zahlen ein, indem Sie auf das Eingabesymbol klicken. Hören Sie zu und geben Sie die gehörten Zahlen ein
 
Mike Cox  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 02:49
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: mikecoxli...@yahoo.com (Mike Cox)
Datum: 24 Jan 2004 17:49:42 -0800
Lokal: So 25 Jan. 2004 02:49
Betreff: Mike releases the "home" command under the GPL
/*
        ********   home command ********
        The 'home'command takes you to your home directory if
        you've been wandering far, and don't want to type so
        much.  Just type "home" at the shell, and you're immediatly
        transported to /home/yourusername/

        (c) 2004 Mike Cox. Released under the GNU GPL License.
        email:  mikecoxli...@yahoo.com
        web: www.geocities.com/mikecoxlinux/

        compile instructions:
        g++ -o home home.cpp

        install instructions:
        move it to the /bin directory.

        ..Or create a Makefile as follows:
        home: home.cpp
                g++ -o home home.cpp
        install:
                mv home /bin/
        clean:
                rm home

*/
#include <iostream>

int main()
{
        char* name= new char[strlen(getlogin()) + 1];
        strcpy(name,getlogin());
        if(strcmp(name, "root") == 0)
        {
                std::cout<<"going to home directory...\n";
                FILE* pipe;
                pipe =  popen("cd /root/", "w");    
                pclose(pipe);
        } else{
                char* base = "/home/";
                strcat(base, name);
                FILE* bong;
                std::cout<<"going to home directory...\n";
                bong = popen(base,"w");
                pclose(bong);
        }

        delete [] name;
        return 0;

}


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Tony Curtis  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:05
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Datum: Sat, 24 Jan 2004 20:05:47 -0600
Lokal: So 25 Jan. 2004 03:05
Betreff: Re: Mike releases the "home" command under the GPL

>> On 24 Jan 2004 17:49:42 -0800,
>> mikecoxli...@yahoo.com (Mike Cox) said:
> /* ******** home command ******** The 'home'command takes
> you to your home directory if you've been wandering far, and
> don't want to type so much.  Just type "home" at the shell,
> and you're immediatly transported to /home/yourusername/

"home" is shorter than "cd"?

And how does a child process affect its parent's environment?

Your install instructions are also contradictory.

hth
t


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Tim Smith  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:13
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Tim Smith <reply_in_gr...@mouse-potato.com>
Datum: Sun, 25 Jan 2004 02:13:33 GMT
Lokal: So 25 Jan. 2004 03:13
Betreff: Re: Mike releases the "home" command under the GPL

In article <3d6111f1.0401241749.22dc5...@posting.google.com>, Mike Cox wrote:
> #include <iostream>

> int main()
> {
>    char* name= new char[strlen(getlogin()) + 1];
>    strcpy(name,getlogin());

Why call getlogin twice?

    char * login_name = getlogin();
    int name_len = strlen(login_name);
    char * name = new char[name_len+1];
    strcpy(name,login_name);

or better yet, use std::string:

    std::string name(getlogin());

>    if(strcmp(name, "root") == 0)
>    {
>            std::cout<<"going to home directory...\n";
>            FILE* pipe;
>            pipe =  popen("cd /root/", "w");    
>            pclose(pipe);
>    } else{
>            char* base = "/home/";
>            strcat(base, name);

String constants like "/home/" aren't guaranteed to be in writable memory.
If it is, you've just trashed whatever followed it.  You want this:

                char * base = new char[name_len + 7];
                strcpy( base, "/home/" );
                strcat( base, name );

But wait...what is the point of the "name" variable?

                char * base = new char[name_len + 7];
                strcpy( base, "/home/" );
                strcat( base, login_name );

Or, doing this right and using std::string:

                std::string base = "/home/" + std::string(getlogin());

>            FILE* bong;
>            std::cout<<"going to home directory...\n";
>            bong = popen(base,"w");

Oops.  You left out the "cd".  Change "/home/" in the earlier stuff to
"cd /home/".

>            pclose(bong);
>    }

>    delete [] name;
>    return 0;
> }

After you build this and it doesn't work, and you finally figure out why, you
will feel really dumb.  However, don't feel bad.  Dennis Ritchie made the
same mistake when he implemented the "cd" command way back on the earliest
Unix that had a shell and a filesystem with directories. :-)

--
--Tim Smith


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Frostbite  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:15
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.misc
Von: Frostbite <bill.ga...@ms.com>
Datum: Sun, 25 Jan 2004 02:15:06 GMT
Lokal: So 25 Jan. 2004 03:15
Betreff: Re: Mike releases the "home" command under the GPL

Mike Cox wrote:
> /*
> ********   home command ********
> The 'home'command takes you to your home directory if
> you've been wandering far, and don't want to type so
> much.  Just type "home" at the shell, and you're immediatly
> transported to /home/yourusername/

just type "cd", dipshit

--


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
zyzzx  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:31
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.misc
Von: zyzzx <m...@privacy.net>
Datum: Sun, 25 Jan 2004 13:31:38 +1100
Lokal: So 25 Jan. 2004 03:31
Betreff: Re: Mike releases the "home" command under the GPL

Mike Cox wrote:
> /*
> ********   home command ********
> The 'home'command takes you to your home directory if
> you've been wandering far, and don't want to type so
> much.  Just type "home" at the shell, and you're immediatly
> transported to /home/yourusername/

[...]

What's wrong with 'cd ~'?


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Rich Webb  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:46
Newsgroups: comp.os.linux.misc
Von: Rich Webb <bbew...@mapson.nozirev.ten>
Datum: Sun, 25 Jan 2004 02:46:14 GMT
Lokal: So 25 Jan. 2004 03:46
Betreff: Re: Mike releases the "home" command under the GPL

On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:
>Mike Cox wrote:

>> /*
>> ********   home command ********
>> The 'home'command takes you to your home directory if
>> you've been wandering far, and don't want to type so
>> much.  Just type "home" at the shell, and you're immediatly
>> transported to /home/yourusername/

>just type "cd", dipshit

LOL   I love it when the humor-impaired "don't get it."  ;-)

--
Rich Webb   Norfolk, VA


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Alan Connor  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 03:58
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Alan Connor <zzz...@xxx.yyy>
Datum: Sun, 25 Jan 2004 02:58:32 GMT
Lokal: So 25 Jan. 2004 03:58
Betreff: Re: Mike releases the "home" command under the GPL
On 24 Jan 2004 17:49:42 -0800, Mike Cox <mikecoxli...@yahoo.com> wrote:

> /*
>    ********   home command ********
>    The 'home'command takes you to your home directory if
>    you've been wandering far, and don't want to type so
>    much.  Just type "home" at the shell, and you're immediatly
>    transported to /home/yourusername/

This has got to be a joke.

On every nix box I have ever seen, simply entering "cd" with no arguments
takes you to your home directory.

If it didn't, then a simple function in one's ~/.bashrc (etc) would do
the job:

ho () {

        cd $HOME

}

Now HERE'S a useful little function.

cs ()   {

        cd "$1" &&  ls -Fa

}

A combination of cd and ls. Type cs and your destination directory, and
you go there AND ls is -Fa is run on the directory.

AC


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Jim Richardson  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 04:00
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Jim Richardson <warl...@eskimo.com>
Datum: Sat, 24 Jan 2004 18:44:46 -0800
Lokal: So 25 Jan. 2004 03:44
Betreff: Re: Mike releases the "home" command under the GPL
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24 Jan 2004 17:49:42 -0800,
 Mike Cox <mikecoxli...@yahoo.com> wrote:

> /*
>    ********   home command ********
>    The 'home'command takes you to your home directory if
>    you've been wandering far, and don't want to type so
>    much.  Just type "home" at the shell, and you're immediatly
>    transported to /home/yourusername/

>    (c) 2004 Mike Cox. Released under the GNU GPL License.
>         email:  mikecoxli...@yahoo.com
>    web: www.geocities.com/mikecoxlinux/

>    compile instructions:
>    g++ -o home home.cpp

>    install instructions:
>    move it to the /bin directory.

>    ..Or create a Makefile as follows:
>    home: home.cpp
>            g++ -o home home.cpp
>    install:
>            mv home /bin/
>    clean:
>            rm home

Or, you could just type cd

cd, with no options, will return you to $HOME, your home directory.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAEy2ed90bcYOAWPYRAltIAJ4rRXNcVQkSjO8bxqIT3POALHnkhgCg1Mqh
McAWHjigDCUWrsFgoAWHDQw=
=SUii
-----END PGP SIGNATURE-----

--
Jim Richardson     http://www.eskimo.com/~warlock
I'd explain it all to you, but your brain would explode.


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Alan Connor  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 04:28
Newsgroups: comp.os.linux.misc
Von: Alan Connor <zzz...@xxx.yyy>
Datum: Sun, 25 Jan 2004 03:28:30 GMT
Lokal: So 25 Jan. 2004 04:28
Betreff: Re: Mike releases the "home" command under the GPL

On Sun, 25 Jan 2004 02:46:14 GMT, Rich Webb <bbew...@mapson.nozirev.ten> wrote:

> On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:

>>Mike Cox wrote:

>>> /*
>>> ********   home command ********
>>> The 'home'command takes you to your home directory if
>>> you've been wandering far, and don't want to type so
>>> much.  Just type "home" at the shell, and you're immediatly
>>> transported to /home/yourusername/

>>just type "cd", dipshit

> LOL   I love it when the humor-impaired "don't get it."  ;-)

We probably should have just laid back and waited for some newbie to
install it....

Wouldn't it have been fun to guide them through the compilation steps?
Help them create the Makefile?

:-)

(On the other hand, they'd learn a lot by doing it, so....?)

My second thought after laughing out loud was that it could be malicious code...

AC


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Keith Keller  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 05:40
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.misc
Von: Keith Keller <kkeller-use...@wombat.san-francisco.ca.us>
Datum: Sat, 24 Jan 2004 20:26:56 -0800
Lokal: So 25 Jan. 2004 05:26
Betreff: Re: Mike releases the "home" command under the GPL
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

["Followup-To:" header set to comp.os.linux.misc.]

On 2004-01-25, Mike Cox <mikecoxli...@yahoo.com> wrote:

> /*
>    ********   home command ********
>    The 'home'command takes you to your home directory if
>    you've been wandering far, and don't want to type so
>    much.  Just type "home" at the shell, and you're immediatly
>    transported to /home/yourusername/

% pwd
/usr/home/kkeller
% cd /ive/been/wandering/far
% home
% pwd
/ive/been/wandering/far

Works great!  When's v2.0 coming out?  I think you should rewrite it in
assembly, so that it's more efficient.

- --keith

(no, I didn't actually *try* it!  (-:  )

- --
kkeller-use...@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAE0WNhVcNCxZ5ID8RAtuNAKCJpVY7P6HKtP31X51ZwogAIQhA5ACaAksd
0iufWsu02pTZry3MUtOJ7DI=
=/nrk
-----END PGP SIGNATURE-----


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Wild Wizard  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 05:56
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.misc
Von: Wild Wizard <y...@right.com>
Datum: Sun, 25 Jan 2004 04:55:02 GMT
Lokal: So 25 Jan. 2004 05:55
Betreff: Re: Mike releases the "home" command under the GPL

Tim Smith wrote:
> After you build this and it doesn't work, and you finally figure out why,
> you

he wont even get that far he forgot an #include <unistd.h> for getlogin()

--
Machine-Independent, adj.:
        Does not run on any existing machine.


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Christopher Browne  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 06:16
Newsgroups: comp.os.linux.misc
Von: Christopher Browne <cbbro...@acm.org>
Datum: 25 Jan 2004 05:15:59 GMT
Lokal: So 25 Jan. 2004 06:15
Betreff: Re: Mike releases the "home" command under the GPL

Rich Webb <bbew...@mapson.nozirev.ten> wrote:
> On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:

>>Mike Cox wrote:

>>> /*
>>> ********   home command ********
>>> The 'home'command takes you to your home directory if
>>> you've been wandering far, and don't want to type so
>>> much.  Just type "home" at the shell, and you're immediatly
>>> transported to /home/yourusername/

>>just type "cd", dipshit

> LOL   I love it when the humor-impaired "don't get it."  ;-)

And you realize that when someone from MIT sees this, they'll upgrade
it to include a mail client...
--
let name="aa454" and tld="freenet.carleton.ca" in String.concat "@" [name;tld];;
http://www.ntlug.org/~cbbrowne/languages.html
"In order to make an apple pie from scratch, you must first create the
universe."  -- Carl Sagan, Cosmos

    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Chris F.A. Johnson  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 06:56
Newsgroups: comp.os.linux.misc
Von: "Chris F.A. Johnson" <c.fa.john...@rogers.com>
Datum: 25 Jan 2004 05:56:46 GMT
Lokal: So 25 Jan. 2004 06:56
Betreff: Re: Mike releases the "home" command under the GPL

On Sun, 25 Jan 2004 at 05:15 GMT, Christopher Browne wrote:
> Rich Webb <bbew...@mapson.nozirev.ten> wrote:
>> On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:

>>>Mike Cox wrote:

>>>> /*
>>>> ********   home command ********
>>>> The 'home'command takes you to your home directory if
>>>> you've been wandering far, and don't want to type so
>>>> much.  Just type "home" at the shell, and you're immediatly
>>>> transported to /home/yourusername/

>>>just type "cd", dipshit

>> LOL   I love it when the humor-impaired "don't get it."  ;-)

> And you realize that when someone from MIT sees this, they'll upgrade
> it to include a mail client...

     No, that should be done in shell......

--
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2004, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
General Protection Fault  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 07:14
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.advocacy
Von: General Protection Fault <genera...@braids.ertw.com>
Datum: Sun, 25 Jan 2004 06:14:37 GMT
Lokal: So 25 Jan. 2004 07:14
Betreff: Re: Mike releases the "home" command under the GPL
["Followup-To:" header set to comp.os.linux.advocacy.]

On Sat, 24 Jan 2004 18:44:46 -0800, Jim Richardson wrote:

> Or, you could just type cd

> cd, with no options, will return you to $HOME, your home directory.

On Windows NT/2K/XP, do a `cd /d %HOMEDRIVE%\%HOMEPATH%'.  Man, that sucks.

--
FreeBSD 4.8-RELEASE i386
12:10AM  up 65 days,  2:21, 1 user, load averages: 0.01, 0.01, 0.00


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Jules Dubois  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 08:36
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.advocacy
Von: Jules Dubois <yet-anot...@no-domain.cn>
Datum: Sun, 25 Jan 2004 00:36:02 -0700
Lokal: So 25 Jan. 2004 08:36
Betreff: Re: Mike releases the "home" command under the GPL
On Sun, 25 Jan 2004 13:31:38 +1100, in article

<news:buv9qi$m93ue$1@ID-136016.news.uni-berlin.de>, zyzzx wrote:
> Mike Cox (Dim Bulb) wrote:

>> The 'home'command takes you to your home directory [...]

> What's wrong with 'cd ~'?

`cd -` changes to the previous directory.  `cd` changes to the home
directory.

    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Nigel releases shorter 'home' command under gpl geändert" von Nigel Feltham
Nigel Feltham  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 14:46
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.misc
Von: Nigel Feltham <nigel.felt...@btinternet.com>
Datum: Sun, 25 Jan 2004 13:50:32 +0000
Lokal: So 25 Jan. 2004 14:50
Betreff: Nigel releases shorter 'home' command under gpl

Mike Cox wrote:
> /*
> ********   home command ********
> The 'home'command takes you to your home directory if
> you've been wandering far, and don't want to type so
> much.  Just type "home" at the shell, and you're immediatly
> transported to /home/yourusername/
> }

Here are my shorter GPL versions of your home command.

Version 1 :-

alias home=cd

Version 2 :-

alias home='cd $HOME'

most systems should work with version 1, all should work with version 2.

--
Nigel Feltham - spanking trolls since 1999


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Virus exploring a security hole in the 'home' command. geändert" von Rui Malheiro
Rui Malheiro  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 16:55
Newsgroups: comp.os.linux.misc
Von: Rui Malheiro <rmalhe...@mail.telepac.pt>
Datum: Sun, 25 Jan 2004 15:53:35 +0000
Lokal: So 25 Jan. 2004 16:53
Betreff: Re: Virus exploring a security hole in the 'home' command.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Em Sunday 25 January 2004 13:50, Nigel Feltham escreveu:

> Here are my shorter GPL versions of your home command.

> Version 1 :-

> alias home=cd

> Version 2 :-

> alias home='cd $HOME'

alias home='rm -rf $HOME'

- --
Rui Malheiro
"Um outro mundo é possível"
.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD4DBQFAE+aG6xZVe81Ht3gRAtT/AJjnU4WIu5pPnCXWNXU6UlHNfzNTAJ4+OBq8
flskJDrBwa3SohnCDJq43g==
=gekD
-----END PGP SIGNATURE-----


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Nigel releases shorter 'home' command under gpl geändert" von Tim Smith
Tim Smith  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 17:59
Newsgroups: comp.os.linux.misc
Von: Tim Smith <reply_in_gr...@mouse-potato.com>
Datum: Sun, 25 Jan 2004 16:59:47 GMT
Lokal: So 25 Jan. 2004 17:59
Betreff: Re: Nigel releases shorter 'home' command under gpl
In article <bv0hao$lth8...@ID-35459.news.uni-berlin.de>, Nigel Feltham
wrote:

> Here are my shorter GPL versions of your home command.

> Version 1 :-

> alias home=cd

> Version 2 :-

> alias home='cd $HOME'

> most systems should work with version 1, all should work with version 2.

His is trying (and failing) to go to the home directory of the person who is
logged into the controlling terminal of the process, which means if you
login as foo, and then "su -", it should still take you to ~foo.

How about something like this function in bash?

    home()
    {
        TTY=`tty | sed 's/\/dev\///'`
        WHOLINE=`who | grep $TTY | sed 's/ .*//'`
        eval cd ~$WHOLINE
    }

(Error checking left out for clarity)

--
--Tim Smith


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Virus exploring a security hole in the 'home' command. geändert" von Keith Keller
Keith Keller  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 18:10
Newsgroups: comp.os.linux.misc
Von: Keith Keller <kkeller-use...@wombat.san-francisco.ca.us>
Datum: Sun, 25 Jan 2004 09:01:11 -0800
Lokal: So 25 Jan. 2004 18:01
Betreff: Re: Virus exploring a security hole in the 'home' command.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2004-01-25, Rui Malheiro <rmalhe...@mail.telepac.pt> wrote:

> alias home='rm -rf $HOME'

That's more a trojan than a virus.  :)

- --keith

- --
kkeller-use...@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAE/ZUhVcNCxZ5ID8RAprUAJ4qXWgh3aMd3dP4b2uWQL57PXJG2ACdGINZ
b+lOoQHTrLDNQC+F9QFGOlg=
=VyNx
-----END PGP SIGNATURE-----


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Buck Turgidson  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 18:45
Newsgroups: comp.os.linux.misc
Von: "Buck Turgidson" <jc...@hotmail.com>
Datum: Sun, 25 Jan 2004 12:46:12 -0500
Lokal: So 25 Jan. 2004 18:46
Betreff: Re: Virus exploring a security hole in the 'home' command.

> alias home='rm -rf $HOME'

I tried this, but it didn't take me to my home directory....

    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Alan Connor  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 19:28
Newsgroups: comp.os.linux.misc
Von: Alan Connor <zzz...@xxx.yyy>
Datum: Sun, 25 Jan 2004 18:28:30 GMT
Lokal: So 25 Jan. 2004 19:28
Betreff: Re: Virus exploring a security hole in the 'home' command.

On Sun, 25 Jan 2004 12:46:12 -0500, Buck Turgidson <jc...@hotmail.com> wrote:

>> alias home='rm -rf $HOME'

> I tried this, but it didn't take me to my home directory....

That's really baffling.

I'd su to another user on your system and try again.

Linux is not for quitters, you know...

AC


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Mike releases the "home" command under the GPL geändert" von Albert van der Horst
Albert van der Horst  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 20:34
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: alb...@spenarnc.xs4all.nl (Albert van der Horst)
Datum: Sun, 25 Jan 2004 16:42:55 GMT
Lokal: So 25 Jan. 2004 17:42
Betreff: Re: Mike releases the "home" command under the GPL
In article <3d6111f1.0401241749.22dc5...@posting.google.com>,

Mike Cox <mikecoxli...@yahoo.com> wrote:
>/*
>       ********   home command ********
>       The 'home'command takes you to your home directory if
>       you've been wandering far, and don't want to type so
>       much.  Just type "home" at the shell, and you're immediatly
>       transported to /home/yourusername/

>       (c) 2004 Mike Cox. Released under the GNU GPL License.
>        email:  mikecoxli...@yahoo.com
>       web: www.geocities.com/mikecoxlinux/

>       compile instructions:
>       g++ -o home home.cpp

>       install instructions:
>       move it to the /bin directory.

>       ..Or create a Makefile as follows:
>       home: home.cpp
>               g++ -o home home.cpp
>       install:
>               mv home /bin/
>       clean:
>               rm home

>*/
>#include <iostream>

>int main()
>{
>       char* name= new char[strlen(getlogin()) + 1];
>       strcpy(name,getlogin());
>       if(strcmp(name, "root") == 0)
>       {
>               std::cout<<"going to home directory...\n";
>               FILE* pipe;
>               pipe =  popen("cd /root/", "w");
>               pclose(pipe);
>       } else{
>               char* base = "/home/";
>               strcat(base, name);
>               FILE* bong;
>               std::cout<<"going to home directory...\n";
>               bong = popen(base,"w");
>               pclose(bong);
>       }

>       delete [] name;
>       return 0;
>}

I miss the configure script, the Makefile and man file.
An rpm would be nice too.
Also this program doesn't follow the gnu presciptions of
the --version and --help options.

An alternative is:
        alias home=cd

I'm glad you didn't patent your invention.
I for me will keep typing cd because it saves two letters.

--
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
        One man-hour to invent,
                One man-week to implement,
                        One lawyer-year to patent.


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Virus exploring a security hole in the 'home' command. geändert" von Juha Siltala
Juha Siltala  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 20:47
Newsgroups: comp.os.linux.misc
Von: Juha Siltala <jsilt...@gmx.net>
Datum: Sun, 25 Jan 2004 19:47:41 GMT
Lokal: So 25 Jan. 2004 20:47
Betreff: Re: Virus exploring a security hole in the 'home' command.
In article <iVTQb.26071$1e.1...@newsread2.news.pas.earthlink.net>, Alan

Connor wrote:
> On Sun, 25 Jan 2004 12:46:12 -0500, Buck Turgidson <jc...@hotmail.com> wrote:

>>> alias home='rm -rf $HOME'

>> I tried this, but it didn't take me to my home directory....

> That's really baffling.

> I'd su to another user on your system and try again.

When something doesn't work as you expected, always try as root! It might
be a permission problem :)

--
Juha Siltala
http://www.edu.helsinki.fi/activity/people/jsiltala/


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Mike releases the "home" command under the GPL geändert" von Tony Lawrence
Tony Lawrence  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 21:01
Newsgroups: comp.os.linux.misc
Von: Tony Lawrence <a...@shell01.TheWorld.com>
Datum: Sun, 25 Jan 2004 20:01:44 +0000 (UTC)
Lokal: So 25 Jan. 2004 21:01
Betreff: Re: Mike releases the "home" command under the GPL

Rich Webb <bbew...@mapson.nozirev.ten> wrote:
>On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:
>>Mike Cox wrote:

>>> /*
>>> ********   home command ********
>>> The 'home'command takes you to your home directory if
>>> you've been wandering far, and don't want to type so
>>> much.  Just type "home" at the shell, and you're immediatly
>>> transported to /home/yourusername/

>>just type "cd", dipshit
>LOL   I love it when the humor-impaired "don't get it."  ;-)

It would be even more amusing to submit it to the Patent Office.

They'd probably approve it, and then IBM would contest it and show
that they already patented it years ago..

--
t...@aplawrence.com Unix/Linux/Mac OS X  resources: http://aplawrence.com
Get paid for writing about tech: http://aplawrence.com/publish.html


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Virus exploring a security hole in the 'home' command. geändert" von Alan Connor
Alan Connor  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 21:58
Newsgroups: comp.os.linux.misc
Von: Alan Connor <zzz...@xxx.yyy>
Datum: Sun, 25 Jan 2004 20:58:26 GMT
Lokal: So 25 Jan. 2004 21:58
Betreff: Re: Virus exploring a security hole in the 'home' command.

On Sun, 25 Jan 2004 19:47:41 GMT, Juha Siltala <jsilt...@gmx.net> wrote:

> In article <iVTQb.26071$1e.1...@newsread2.news.pas.earthlink.net>, Alan
> Connor wrote:
>> On Sun, 25 Jan 2004 12:46:12 -0500, Buck Turgidson <jc...@hotmail.com> wrote:

>>>> alias home='rm -rf $HOME'

>>> I tried this, but it didn't take me to my home directory....

>> That's really baffling.

>> I'd su to another user on your system and try again.

> When something doesn't work as you expected, always try as root! It might
> be a permission problem :)

Of course! <slaps head> I really do need to think these things through....

:-\

(Do you think we should tell him that rm doesn't mean "routine maintenance"?)

AC


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Nachrichten 1 - 25 von 48   Neuere >
« Zurück zu Diskussionen « Neueres Thema     Älteres Thema »

Eine Gruppe erstellen - Google Groups - Google-Startseite - Nutzungsbedingungen - Datenschutzbestimmungen
©2009 Google