The string of commands contains a flaw, because for the awks FS is not set prior to reading the input (but while on line 1), the field splitting will only be in effect on line 2 and further (and line 3 by the time we get tot the last awk...and the first results will not be printed)
So FS needs to be set beforehand, plus we could combine that grep and all of the awks into one:
The awk can be changed so that occurrences can be counted like so:
This User Gave Thanks to Scrutinizer For This Post:
I'm trying to write the filenames only to a file. The following line works:
ls -l /home/alex >> log/filetrack.log
But the file filetrack.log also contains the "total" i.e. the first line is total 3462984
Also, I would like only the filename, date and size to be listed. However, my main... (3 Replies)
I have a file with four fields and an awk script that strips out one field displaying the remaining three. I have added headings for each of these fields such as Player - Year - RBIs then below it comes the data. What I am trying to do is sort the RBIs field in my script from most to least at the... (9 Replies)
hello people
i need your help please
i want to achieve the following with the simplest, most efficient shell-tools:
i have a directory with a lot of files from users.
the script should check which partition the dir is on
if the partition with the directory is more than 90% full
... (2 Replies)
Hi
First field is the Record Type. A Record Type 5 can have multiple Record Type 6's before another Record Type 5 appears.
I want to calculate the total of fields at position 8-11 on Record type 6 when Record Type 5 has a field at position 11-14 equals to '2222'. then it should delete the lines... (2 Replies)
I have many files .dat extension.
requirement is to display line no
if no of delimiter does not matches in a given variable
lets say
File: REF_BETOS.dat
HCPCS_OR_CPT_CODE~BETOS_CODE~TERMINATION_DATE
0001F~Z2~
0003T~I4~B20061231
0005F~Z2~~~
0008T~P8~B20061231... (1 Reply)
Hi,
I need a way to grab the total combines since inception, total pages read from webalizer on my centos server or any other location (as long as since inception) and display the result live on my website
So with each visit it would be increasing, or perhaps live (ajax) not sure
But can... (0 Replies)
Hi,
Using Redhat, how do I display total hard disk size? I know how to do that in Solaris, you can type, format. It will show how big the disks are.
This is what I did so for.
$ df -t ext3 -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
... (1 Reply)
1. The problem statement, all variables and given/known data:
I have a file with a fragment of a novel, which I have to clear from punctuation and sort all the words contained one per line and non duplicated, all this going to a file called "palabras".
Here is fragment of the input file:
... (4 Replies)
I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)