Sponsored Content
Full Discussion: unix cmd
Top Forums Shell Programming and Scripting unix cmd Post 66372 by Ygor on Sunday 13th of March 2005 08:12:41 PM
Old 03-13-2005
awk 'NR==1{print $4;exit}' file1
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

get only a few lines from a unix cmd

I'd like to get only the first 5 lines of the ls -lt command, i tried to pass to head as a file ip but didnt work, is there any other way to do it. I am trying to find the lates log files for the last 5 days. what i tried head -5 < ls -lt alog* Thanks. -d (1 Reply)
Discussion started by: dharma
1 Replies

2. Shell Programming and Scripting

Using Unix screen cmd effecting Vi editor

Hello, I enjoy using the unix screen utility, but my vi sessions lose the ability to syntax highlight code and split screen(:vs or :sp). When not using screen, I can do those things within vi. Anybody experience this and know the fix? Thanks (1 Reply)
Discussion started by: geephei
1 Replies

3. Shell Programming and Scripting

Combining many lines to one using awk or any unix cmd

Combining many lines to one using awk or any unix cmd Inputfile: Output : Appreciate help on this. (14 Replies)
Discussion started by: pinnacle
14 Replies

4. Programming

Storing the output of a Unix cmd in my C program

Hello experts, How can I retrieve the output from a Unix command and use it as string variable in my C program? For example, when I issue the command 'date' I get: Tue Jun 11 09:54:16 EEST 2009 I do not want to redirect the output of the command to a file and then open the file from... (3 Replies)
Discussion started by: Goseib
3 Replies

5. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

6. Shell Programming and Scripting

how to call unix script in informatoca thrgh cmd task

how to call unix script in informatoca thrgh cmd task (0 Replies)
Discussion started by: sunilamarnadh
0 Replies

7. Shell Programming and Scripting

how to change unix cmd display prompt?

I am new to to unix and I want to make my own basic shell. What is the code I can use to change the unix cmd console display? For example my unix display prompt says MyCompterName~, I want it to say WhatEverMan~ (3 Replies)
Discussion started by: megaearth77
3 Replies

8. UNIX for Dummies Questions & Answers

UNIX one line cmd join 2 sets of data from 2 files

Hi all, This is my first and undoubtedly many posts to come. I'm new to using unix and would like a hand with this problem I have. What i'm trying to do is match 2 sets of data from 2 files and put result into file 3. Sounds simply but there is a catch, the match is a "partial field" match, if... (2 Replies)
Discussion started by: tugar
2 Replies

9. AIX

UNIX cmd to check for non expiry type password

Hi, Here's the version of unix that we are working on. > uname -a AIX yyyyyyyy 1 6 00F613E24C00 @:on(cluster303)/iishomea/kmani00-> i have application id: aaabbb Now i need to check whether the password for the application id set to non expiry type or not. Moreover, with that unix... (3 Replies)
Discussion started by: kmanivan82
3 Replies

10. Shell Programming and Scripting

UNIX cmd -find empty files in folder else sleep for 8hrs

Hello, I am trying to write a unix cmd , that if files in folder /path/FTP are all zero kb or empty then good to go, if not empty then sleep for 8 hrs. Following cmd list me the files which are not empty, But when I am incorporating IF ELSE cmd fails find /path/FTP. -type f -exec wc -l {}... (6 Replies)
Discussion started by: bluestarmoon
6 Replies
JOIN(1) 						      General Commands Manual							   JOIN(1)

NAME
join - relational database operator SYNOPSIS
join [ options ] file1 file2 DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If one of the file names is the standard input is used. File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con- sists of the common field, then the rest of the line from file1, then the rest of the line from file2. Input fields are normally separated spaces or tabs; output fields by space. In this case, multiple separators count as one, and leading separators are discarded. The following options are recognized, with POSIX syntax. -a n In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -v n Like -a, omitting output for paired lines. -e s Replace empty output fields by string s. -1 m -2 m Join on the mth field of file1 or file2. -jn m Archaic equivalent for -n m. -ofields Each output line comprises the designated fields. The comma-separated field designators are either 0, meaning the join field, or have the form n.m, where n is a file number and m is a field number. Archaic usage allows separate arguments for field designators. -tc Use character c as the only separator (tab character) on input and output. Every appearance of c in a line is significant. EXAMPLES
sort /etc/passwd | join -t: -1 1 -a 1 -e "" - bdays Add birthdays to the /etc/passwd file, leaving unknown birthdays empty. The layout of /adm/users is given in passwd(5); bdays con- tains sorted lines like tr : ' ' </etc/passwd | sort -k 3 3 >temp join -1 3 -2 3 -o 1.1,2.1 temp temp | awk '$1 < $2' Print all pairs of users with identical userids. SOURCE
/src/cmd/join.c SEE ALSO
sort(1), comm(1), awk(1) BUGS
With default field separation, the collating sequence is that of sort -b -ky,y; with -t, the sequence is that of sort -tx -ky,y. One of the files must be randomly accessible. JOIN(1)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy