Sponsored Content
Full Discussion: Gawk Question
Operating Systems SCO Gawk Question Post 302916985 by Don Cragun on Friday 12th of September 2014 10:12:09 PM
Old 09-12-2014
Quote:
Originally Posted by trolley
Tried your suggestion and it did not work.
That sure helps us track down the problem...

Show us your exact script.

Show us the exact command you used to invoke it.

On the other hand, it looks like I left in too much of your original code. Try:
Code:
chkstr="$1"
gawk -v chkstr="$chkstr" -F: '$1~chkstr {print $2}' go.dat

(i.e., remove the / characters surrounding chkstr in the awk script).

Last edited by Don Cragun; 09-12-2014 at 11:16 PM.. Reason: Add possible fix.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

gawk HELP

I have to compare records in two files. It can be done using gawk/awk but i am unable to do it. Please help me File1 ABAAAAAB BC asa sa ABAAABAA BC bsa sm ABBBBAAA BC bxz sa ABAAABAB BC csa sa ABAAAAAA BC dsa sm ABBBBAAB BC dxz sa File 2 ABAAAAAB BC aas ba ABAAAAAB BC asa sa... (6 Replies)
Discussion started by: sandeep_hi
6 Replies

2. Shell Programming and Scripting

gawk will work or not ?

Hai I am using bash-2.03$ bash --version GNU bash, version 2.03.0(1)-release (sparc-sun-solaris) I am not able to use gawk command its showing command not found , why ? Eg: awk 'NR==1' fix.txt | gawk 'BEGIN { FIELDWIDTHS = "3 2" } { printf($1"|"$2); }'... (3 Replies)
Discussion started by: tkbharani
3 Replies

3. Shell Programming and Scripting

gawk script

Hey guys need your help with an gawk script... here's what I have so far gawk '^d/ {printf "%-20s %-10s %-10s %-10s %-4s%2s %5s\n",$9,$1,$3,$4,$6,$7,$8}' ls.kbr The file ls.kbr is a capture of 'ls-al' What I want gawk to do is: 1) Find only directories (this is working) 2) skip lines... (2 Replies)
Discussion started by: zoo591
2 Replies

4. Shell Programming and Scripting

gawk and bash

Hi. I'm having trouble using gawk within a bash script and I can't figure out why. I have a command that takes in a data file with two columns, the first one numbers and the second words. My code takes each line, and prints the word its corresponding number of times. The code works from the... (2 Replies)
Discussion started by: cdislater
2 Replies

5. Shell Programming and Scripting

Gawk Help

Hi, I am using the script to print the portion of the file containing a particular string. But it is giving error "For Reading (No such file or directory). I am using cygwin as unix simulator. cat TT35*.log | gawk -v search="12345678" ' /mSOriginating /,/disconnectingParty/ { ... (1 Reply)
Discussion started by: vanand420
1 Replies

6. Shell Programming and Scripting

Gawk filter

People, Ive been trying to make a script but i just cant figure it out. Problem/ Case: I have a logfile.txt that contains data. The only two things i need to filter on = $1 (date), $6 (errorcode). In the script i am trying to make, u need to fill in a date. So he searches on that date... (11 Replies)
Discussion started by: Pow3R
11 Replies

7. Programming

need help with gawk script

hi i've already created this script. When I execute the script it takes the argument and compares it to the 3rd column of the script. What I was wondering if I could get some help with is. I want to add another column to the script and it will be the result of a set number for example, (2000 - 3rd... (3 Replies)
Discussion started by: gengar
3 Replies

8. Shell Programming and Scripting

Gawk and sed question

Can anyone tell me what this script does? sort file1.txt | awk -F, -f event.gawk Thank you. (2 Replies)
Discussion started by: dee campbell
2 Replies

9. SCO

Need help with gawk

I am trying to use gawk to search a file and put the second value of the string into a string. gawk -F: '$1~/CXFR/ {print $2}' go.dat Below is the file 'go.dat' ==================== HOME :/ CTMP :/tmp CUTL :/u/rdiiulio/bin CWRK :/u/work CXFR :/u/xfer ... (1 Reply)
Discussion started by: trolley
1 Replies

10. Shell Programming and Scripting

Gawk and regexp

Hello, This is a problem I've worked on a while and can't figure out. There is a file.txt ..some stuff.. ] ] ..some stuff.. The Awk program is trying to extract the year portion of the birth and death ("98: and "2nd C.") using the below technique #!/bin/awk @include... (5 Replies)
Discussion started by: Mid Ocean
5 Replies
SMFSH(1)																  SMFSH(1)

NAME
smfsh - SMF shell SYNOPSIS
smfsh [ -V ] [ file ] OPTIONS
-V Print libsmf version and exit. file Load the file. DESCRIPTION
smfsh, an "SMF shell", is an interactive, command-driven frontend to libsmf, useful for modifying MIDI files by hand. It started its life as a debugging aid for libsmf. There are four groups of commands: SMF level, track level, event level, and others. SMF LEVEL COMMANDS
SMF level commands display or change properties of smf (i.e. the MIDI file) as a whole. save file Save a file. If the file name is not given, the last file name is used. Note that this will not ask for confirmation. load file Load a file. If the file name is not given, the last file name is used. Instead of using "load", you can pass the file name on the command line. ppqn new-ppqn Show (if used without parameter) or change PPQN (Pulses Per Quarter Note, aka Division). format new-format Show (if used without parameter) or change format. tempo Show tempo map. Tempo map is computed automatically from the SMF contents - to modify a tempo, just add a Tempo Change event using "add" command. length Show total length of the song. Just like the tempo map, file length is computed from the SMF contents. TRACK LEVEL COMMANDS
Track level commands display or change properties of tracks. SMF may contain one or more tracks. tracks Show the list of tracks in the SMF. track track-number Show details of a track (if called without parameter), or select track with a given number - for example in order to display ("events") the events it contains. trackadd Create new track. trackrm track-number Remove the track. If the track number is not given, this will remove the track currently selected. EVENT LEVEL COMMANDS
Event level commands display or change properties of events. Events are grouped into tracks. Track may contain any number of events, including zero. events Show the list of events in the current track. event event-number Show information about a current event (if used without parameter) or select the event. add time-in-seconds midi-message-as-hex Add new event to the currently selected track. rm event-number Remove the event. If the event number is not given, this will remove the event currently selected. OTHER COMMANDS
There are three commands in the "other" category - "help", "version", and "exit". Their meaning should be self expanatory. smfsh 1.3 21 March 2010 SMFSH(1)
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy