question about shell commands...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting question about shell commands...
# 1  
Old 01-29-2010
question about shell commands...

Hello,
I have the following is a txt file:
!!! man.uni.com address 141.000.001 to you.uni.com
!!! man.uni.com address 141.000.002 to wae1.uni.com
!!! man.uni.com address 141.000.003 to kim2.uni.com

I want to get you,wae and kim from the text and put them in a diffrent file in the following format:
-you
-wae
-kim

how can I do that(by using cut,grep,sed)?
# 2  
Old 01-29-2010
Quote:
Originally Posted by andrew1400
Hello,
I have the following is a txt file:
!!! man.uni.com address 141.000.001 to you.uni.com
!!! man.uni.com address 141.000.002 to wae1.uni.com
!!! man.uni.com address 141.000.003 to kim2.uni.com

I want to get you,wae and kim from the text and put them in a diffrent file in the following format:
-you
-wae
-kim

how can I do that(by using cut,grep,sed)?
andrew1400,

Is this homework?
# 3  
Old 01-29-2010
Quote:
Originally Posted by Franklin52
andrew1400,

Is this homework?
well its a part of my lab
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX commands question

I am using HP-UXsystem. I am unable to use the below sed commands. could you please let us know the alternate commands for it. >sed '/unix/ c "Change line"' file.txt sed '/unix/ i "Add a new line"' file.txt any inputs please (5 Replies)
Discussion started by: ramkumar15
5 Replies

2. Shell Programming and Scripting

UNIX commands question

if ] then rm -rf Can anyone tell me what are they checking in the if loop Please use code tags next time for your code and data. Thanks (2 Replies)
Discussion started by: ramkumar15
2 Replies

3. UNIX for Dummies Questions & Answers

Beginner UNIX question. tail and find commands

hey guys, i'm in a unix course.. and while this is a homework question - i did put alittle effort into it. just wanted to ask before trial and error drives me nuts. question 13 has us saving the last 30 characters of a file into another file and question 14 has us saving the list of all the... (1 Reply)
Discussion started by: labelthief
1 Replies

4. Shell Programming and Scripting

Any shell or hack that makes the shell command line take vi commands?

basically i'm tired of hitting the left arrow a few dozen times when correcting a mistake or modifying a history command i'd like to use vim style key shortcuts while on the command line so that a 55 moves the cursor 55 places to the left... and i want all the other vi goodies, search of... (3 Replies)
Discussion started by: marqul
3 Replies

5. Shell Programming and Scripting

Question about awk commands

what does this mean? cat /etc/passwd | awk -F: '{print $5}' | \ awk -F, '{print $1}' | \ awk '{print tolower($l)};{print tolower($2)}' | \ grep -v '^$' >> local_tmp (1 Reply)
Discussion started by: hin-linux
1 Replies

6. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

7. Shell Programming and Scripting

ssh commands in ksh question

Is there a way to shorten these commands? because this script asks for a password 3 times scp -p /usr/local/bin/${script_name} ${servername$iy]}://usr/local/bin/ ssh ${servernames} /usr/local/bin/${script_name} ssh ${servernames} rm -f /usr/local/bin/${script_name} Basically, I'm creating a... (3 Replies)
Discussion started by: pdtak
3 Replies

8. UNIX for Dummies Questions & Answers

Question about batched commands

Hi everyone I am a newbbie in the linux enviroment. My problem is: I have tried to use the at command to compile and keep running a program and close the terminal window. Every time I use the at command I get the next error "Can't open /var/run/atd.pid to signal atd. No atd running?" ... (2 Replies)
Discussion started by: fenixbeta
2 Replies

9. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies

10. Shell Programming and Scripting

KORN Shell - Spawn new shell with commands

I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server.. I have seen some code that may help - but I cant get it working as below: spawn /usr/bin/ksh send "telnet x <port_no>\r" expect "Enter command: " send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies
Login or Register to Ask a Question