I am searching some rather large text files using grep and or awk.
What I would like to know is if there is a way (either with grep, awk, or realy any other unix tool) to stop the search when a predifined number of results are returned.
I would like to do this for speed purpuses. When i get... (6 Replies)
I am awk-ing a line, and only want to get the results of the five chrs. following my field seperator. the line of prose is:
Unit=01982 (PICO RIVERA)
Unit=I1001 (INTERMOUNTAIN AREA)
Unit=E1000 (INTERMOUNTAIN WEST DIVISION)
failing in using an awk of:
awk -F= '/Unit/{print $2 length(5)}'... (3 Replies)
I try to get the month (of last save) and the filename into a variable, is this possible ?
something like this :
for month in `ls -la | awk '{print $6}'`
do
if ]
then
a=filename of the matching file
cp $a /Sep
fi
thanks,
Steffen (1 Reply)
Hey, I'm trying to use awk for some simple file manipulations but i'm getting soem wierd results.
So i want to open up a file which looks like this:
@relation 'autoMpg'
@attribute a numeric
@attribute b numeric
@attribute c numeric
@data
-1.170815,0.257522,0.016416... (2 Replies)
Hi all,
I'm new to awk and I'm experiencing syntax error that I don't know how to resolve. Hopefully some experts in this forum can help me out.
I created an awk file that look like this:
$ cat myawk.awk
BEGIN {
VAR1=PATTERN1
VAR2=PATTERN2
}
/VAR1/ { flag=1 }
/VAR2/ { flag=0 }
{... (7 Replies)
In the following line The AWK statement parses through a listing for files and outputs the results using the {print} command to the screen. Is there a way to (a) send the output to a file and (b) actually perform a cp cmd to copy the listed files to another directory?
ls | awk -va=$a -vb=$b... (1 Reply)
I have files structured in stanzas, whose title is '', and the rest couples of 'id: value'. I need to find text within the title and return the whole stanzas that match the title.
The following works:
awk 'BEGIN{RS="";IGNORECASE=1}/^\/' myfileI would need to count all of the occurences, though,... (7 Replies)
Hi,
The following awk command :
asmcmd lsdg | awk '{print $13;}' | grep -i ${SID}
return the following output . An Empty line + two lines contain "/" at the end of the line
INDEVDATA/
INDEVFRA/
I need to remove the "/" as well as the empty line.
Please advise
Thanks (3 Replies)
im using the code below to monitor a file:
gawk '{
a += gsub("(^| )accepted( |$)", "&")
a += gsub("(^| )open database( |$)", "&")
} END {
for (i in a)
printf("%s=%s\n", i, a)
}' /var/log/syslog
the code is searching the syslog file for the string "accepted" and "open... (2 Replies)
i run the command
snmptable -v2c -c public myIP IF-MIB::ifTable
the result look like this :
SNMP table: IF-MIB::ifTable
ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus
1 Unit: 1 Slot: 0 Port: 1... (7 Replies)
Discussion started by: wanttolearn1
7 Replies
LEARN ABOUT SUNOS
shells
shells(4) File Formats shells(4)NAME
shells - shell database
SYNOPSIS
/etc/shells
DESCRIPTION
The shells file contains a list of the shells on the system. Applications use this file to determine whether a shell is valid. See getuser-
shell(3C). For each shell a single line should be present, consisting of the shell's path, relative to root.
A hash mark (#) indicates the beginning of a comment; subsequent characters up to the end of the line are not interpreted by the routines
which search the file. Blank lines are also ignored.
The following default shells are used by utilities: /bin/bash, /bin/csh, /bin/jsh, /bin/ksh, /bin/pfcsh, /bin/pfksh, /bin/pfsh, /bin/sh,
/bin/tcsh, /bin/zsh, /sbin/jsh, /sbin/sh, /usr/bin/bash, /usr/bin/csh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/pfcsh, /usr/bin/pfksh,
/usr/bin/pfsh, and /usr/bin/sh, /usr/bin/tcsh, /usr/bin/zsh. Note that /etc/shells overrides the default list.
Invalid shells in /etc/shells may cause unexpected behavior (such as being unable to log in by way of ftp(1)).
FILES
/etc/shells lists shells on system
SEE ALSO vipw(1B), ftpd(1M), sendmail(1M), getusershell(3C), aliases(4)SunOS 5.10 4 Jun 2001 shells(4)