473,395 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

question about about Bourne Shell programming

I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me
Apr 1 '08 #1
2 1539
I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me
This code gets two file names from the command prompt
if the contents in your file $1(first arg) and $2(second arg) contains numerals or alphabets or alphanumerals they would be sorted in a reverse order listing all the lines without repetition and cut the fields 1-4 from the output(perhaps all the lines would be printed cause no delimiter is specified)
Apr 1 '08 #2
gpraghuram
1,275 Expert 1GB
I would like to know what does the code below do

#!/cs/local/bin/sh
(cat $1; cat $2) | sort -r | uniq -d | cut -f1,4

can anybody explain it to me

Whenever i encounter a command like this, i would break it into different commands and then see what every command does.



Raghuram
Apr 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
2
by: biner | last post by:
Hello, I have file called PARAMETRES that is used in bourne shell script to define variable. In order to do so I put a ". PARAMETRES" line and the script has acces to all the variable defined in...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
10
by: Steven T. Hatton | last post by:
# -- "If our hypothesis is about anything and not about some one or more particular things, then our deductions constitute mathematics. Thus mathematics may be defined as the subject in which we...
5
by: Patrick Dickey | last post by:
Hello, All! I'm modifying some source code that I downloaded from Planet-source-code a while back, and have a question about Try Catch statements. Basically, I'm wondering if I can do a Try with...
39
by: anonymous | last post by:
Dear All, >From my understanding of pointers, a pointer should not be able to access a memory location until that memory has been allocated either by assiging the address of a variable or...
1
by: nancy | last post by:
I am new to PHP but have done other programming can someone please hold my hand and slowly talk me through some simple security issues? I have seen in PHP documents that there are 'strip...
1
by: nanosuna | last post by:
Hi, I was given a task to translate a unix bourne shell script that does file renaming and string replacement on a server . I am not too familiar with the capabilites of JavaScript, so I was...
2
by: Dave Dean | last post by:
Hi all, I'm just starting out in sockets/network programming, and I have a very basic question...what are the 'security' implications of opening up a socket? For example, suppose I've written a...
2
crystal2005
by: crystal2005 | last post by:
Hi all, I have been googling to search an example code of archiving (E.g. .tgz .tar .zip) for my research. However, unluckily i found none. Is there anyone can help to find one? Oh yeah, I'm...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.