Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-10-2011, 04:50 PM   #1
LQ Newbie
Registered: Jan 2011
Posts: 25

Rep: Reputation: 1
Stuck on join command from book


Going through book, "Guide to UNIX Using Linux". I am doing one of the projects that has me writing scripts to join files. Here is my pnumname script and I am extracting the programmers names and numbers from the program file and redirecting the output to the file pnn. I then created a joinall script where I am trying to join the files pnn and pnumname and redirect the output to pactrep. When I run the script sh joinall and use less to display the contents of the redirected file pactrep, I get an error- join: extra operand `pnum'
Try `join --help' for more information....
I went to the man pages but I still (obvious) do not have a solid grasp. Thanks for the help in advance.

# Script Name: pnumname
# By: J.D.
# Date: February 2011
# Purpose: Extract Programmer Numbers and Names
cut -d: -f1-4 programmer | sort -t: -k 1 | uniq > pnn
# The above cuts out fields 1 through 4.
# The output is piped to a sort by programmer number.
# The sorted output is piped to uniq to remove
# duplicates.
# Uniq redirects the output to pnn.

output file pnn results...

cat pnn

joinall script

# Script Name: joinall
# By: J.D.
# Date: February 2011
# Purpose: Join pnum and pnn to create a report file
# Join the file including the unassigned programmers.
# You do this by placing the programmer names (pnn) file,
# forst, in the join sequence.
join -t: a1 -j1 1 -j2 1 pnn pnum > pactrep

Last edited by thebeav; 02-10-2011 at 04:56 PM.
Old 02-11-2011, 09:23 AM   #2
LQ Newbie
Registered: Jan 2011
Posts: 25

Original Poster
Rep: Reputation: 1
I solved it, I am so stupid sometimes. -a1 , I forgot to minus


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i need some join command help? DaDead Linux - Newbie 3 10-31-2009 03:00 PM
LFS newbie stuck in Linux API headers step 5.5 LFS book 6.3 Vxplus Linux From Scratch 2 11-10-2008 08:13 PM
join command error UnixKiwi Programming 12 01-22-2008 11:36 PM
Unable to join domain using Net Join command in FC3 client jeb083079 Linux - Networking 9 07-30-2007 02:41 AM
net join ads command Steve1445 Linux - Networking 4 02-25-2005 07:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration