Closed Thread Icon

Topic awaiting preservation: need help w/ PERL and *nix (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11959" title="Pages that link to Topic awaiting preservation: need help w/ PERL and *nix (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: need help w/ PERL and *nix <span class="small">(Page 1 of 1)</span>\

 
lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 12-19-2001 10:39

Hello

I'm a newbie in *nix systems...

1)In DOS i can do this: copy con filename.txt, then i write and write and type the EOF char. CTRL+Z (^Z)
what is the equivalent in *nix?

2)In DOS, I can type: prompt $p$g or any other variation...how can i change the prompt in *nix so it indicates the full path that i'm working in?

3)In win32/dos, I can type winipcfg for example to get current machine IP, how can i do that in *nix ?

I'm using BASH as my shell.


GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-19-2001 12:24

1) cp filename newfilename

2) ahm, dont know, but 'pwd' gives you the actual directory.

3) dont know either. i think this depends on what *nix you are running. on HP Unix for example you can type finger to list all logged in users and their IPs.

do a google search...



lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 12-19-2001 14:16

GRUMBLE, 'pwd' might help; i'll try it,

I know how to 'copy' files...I want to know how I can end my <STDIN> input...in MS operating systems, we end the input via CTRL+Z (^Z) how can i do so in *nix?



GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-19-2001 14:23

ah, me thinks that would be:
CTRL+D

edit: heh, i wrote STRG+D.... stupid me.

[This message has been edited by GRUMBLE (edited 12-19-2001).]

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 12-19-2001 16:25

hey Grumble, thanks it worked,
now left one unanswered question: (3)

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 12-19-2001 18:52

ifconfig


bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-19-2001 19:37

as max said ifconfig will give you a bunch of info. On my sys I need to be logged in as root for this to be in my path otherwise I need to go to the actual directory to run it (/sbin/ifconfig)

Also there are a bunch of ways to change the prompt

[mikey@bit mikey] PS1="[\W \u@\h]"

should give you something like what you are looking for.
This: http://www.linuxdoc.org/HOWTO/Bash-Prompt-HOWTO/
is what you need



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:


[This message has been edited by bitdamaged (edited 12-19-2001).]

Mr. Pecker
Nervous Wreck (II) Inmate

From: Goslow
Insane since: Apr 2001

posted posted 12-19-2001 20:51

Whoa, I've never seen the 'copy con filename' before, thats pretty nifty... anyways

you can use 'cat' to do what you're trying to do with copy

$ cat > filename (or cat >> filename, to append)
blah blah blah
^C

cat can also be used to display files like 'type' does in dos

$ cat filename
blah blah blah
$

my examples suck, but you get the idea
make sure theres a line return at the end, if you hit ^C at the end of a line of text, it wont save the line

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 12-20-2001 12:44

thanks mr.Max, butcher, that'll help.

Hey mr.Pecker, I was also going to ask for something like 'type' and you said: 'cat'

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 01-15-2002 11:52

in reply to my own question:

quote:
2)In DOS, I can type: prompt $p$g or any other variation...how can i change the prompt in *nix so it indicates the full path that i'm working in?


you can type this:

code:
$ set PS1='[\u@\h $PWS] '


this will change the prompt to:
[user_name@current_host CURRENT_FULL_PATH] $ .....


« BackwardsOnwards »

Show Forum Drop Down Menu