use two unix commands to solve the following problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users use two unix commands to solve the following problem
# 1  
Old 01-20-2007
use two unix commands to solve the following problem

Hi, all,

The following commands could compute the 10 most frequent bigrams from a input sequence which is in a file infile.

I would like to know whether there is somebody who can use only two unix commands to do the same work.

--------------------
tr " " "\012*" <infile >out1
tail +2 out1 > out1.new
paste out1 out1.new|sort |uniq -c|sort -r|head -10
--------------------

Thanks in advance.
# 2  
Old 01-20-2007
Question sample ip/op

Sample i/p and o/p would be appreciated.
# 3  
Old 01-20-2007
sampe input output

input file contains
d a t a b a s e s t o r e s d a t a

output

2 t a
2 e s
2 d a
2 a t
1 t o
1 s t
1 s e
1 s d
1 r e
1 o r
# 4  
Old 01-20-2007
Homework questions are not permitted.

Thread closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execution problem unix commands in Perl CGI

I am trying to run SSH , mkdir and other unix commands using Perl CGI. But i am not able to Execute these commands. Please help me out !!!! SSH and mkdir is necessity for me. I will be thankful to you...!!!!! I am trying like: In perl CGI file i am writing like: @list = `ssh... (28 Replies)
Discussion started by: Navrattan Bansa
28 Replies

2. Shell Programming and Scripting

Help me solve this scripting problem please

Hello, I would really appreciate some help into approaching this problem: - i have a random txt file with x lines and y rows following this pattern: ex: ip1 | user1 | command ip2 | user2 | command ip3 | user3 | command - i need to telnet/ssh into these ip's, login with... (7 Replies)
Discussion started by: catalinstk
7 Replies

3. UNIX for Dummies Questions & Answers

A problem with a few UNIX commands

Hi guys , I'm new in UNIX and Linux ,and would appreciate your help (very) with the following questions . 1. how can I display all the files in the /home subdirectory tree usnig find and file . I'm supposed to do this in TWO different ways 2.using grep ,I need to isolate the line int... (2 Replies)
Discussion started by: cordel
2 Replies

4. UNIX for Advanced & Expert Users

how would you solve this problem?

I have a file process.txt I wanted to just grab data in "process" column. Name process process_id status Adminserver adminserver 22669 Running Browser Engine browserengine ... (7 Replies)
Discussion started by: soemac
7 Replies

5. UNIX for Advanced & Expert Users

How to solve restarting problem

Hi! My unix os version is OSF1 CP1 V4.0 878 alpha. It startup normally but it restarts within 5 sec. I would like to know how to solve . Please reply to me. Thanks . akzin (2 Replies)
Discussion started by: akzin
2 Replies

6. UNIX for Dummies Questions & Answers

Problem running plsql & unix commands in 1 script

Hi, I need help again. When I run this shell script, it only runs the unld_date.sql piece and exits. How can I structure this to run all the way to the end? When I don't have the unld_date.sql piece in here, everything runs fine from the date compare piece all the way to the end. Thanks in... (5 Replies)
Discussion started by: siog
5 Replies

7. Programming

Can any one solve this Problem...!!!

Try to solve this.....It's a nice program..... #include<stdio.h> void change() { /*Write something in this function so that the output of printf in main function should give 5 . Do not change the main function */ } void main() { int i=5; change(); (9 Replies)
Discussion started by: Baba B. Saheb
9 Replies

8. UNIX for Advanced & Expert Users

can't solve that problem [PLEASE HELP]

well, my internet brakes down every day because of my server, i don't have troubles with RAM or anything i think... that problem started since i am running an unrealircd server... well, my internet brakes down and when i try to access the inside ip from the server on http port 80, it says that:... (2 Replies)
Discussion started by: AiRkO
2 Replies

9. Programming

How can I solve this problem?

I'm now designing a server application which can serve large number of clients' request. I've a question to ask, that is, main process will block when invoke the "accept" function, if a client request comes, main process should be separated into 2 processes by invoking "fork" function, the parent... (4 Replies)
Discussion started by: acqy
4 Replies
Login or Register to Ask a Question