Sponsored Content
Full Discussion: AWK/Bash script
Top Forums Shell Programming and Scripting AWK/Bash script Post 302638617 by balajesuri on Thursday 10th of May 2012 12:39:49 PM
Old 05-10-2012
It'd be better if you can tell us your requirement, provide sample input and an example of desired output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Bash script - set, awk

Trying to search a log file for a string, starting from a certain point in the log file. I want to return the number of lines that contain the search string and the total number of lines in the log file. Here's the part of the script I'm having problems with: set -- $(awk -v... (12 Replies)
Discussion started by: mglenney
12 Replies

2. UNIX for Dummies Questions & Answers

using awk inside bash script?

Hello, I'm trying to write a bash script that will query the current system time (OS X 10.6.6) and then convert the output from HH:MM:SS into time in seconds. The output of the system time command (systemsetup -gettime) is returned as: Time: HH:MM:SS so I wanted to use awk -F: to grab... (5 Replies)
Discussion started by: xaiu
5 Replies

3. Shell Programming and Scripting

AWK manipulation in bash script

EDIT: This has been SOLVED. Thanks! Greetings everyone, I've posted a few threads with some quick help questions, and this is another one of those. I can't post enough gratitude for those much more knowledgeable than myself who are willing to give good advice for my minor issues. Now,... (2 Replies)
Discussion started by: Eblue562
2 Replies

4. Shell Programming and Scripting

Using AWK in a bash script

So I am a newbie obviously but I need some help. I am trying to run a script to check that the number of fields in a database is equal to 4, if not they should try again and run an appropriate database file. The fields are separated by a semi colon. I've tried a lot of things, this what I'm... (3 Replies)
Discussion started by: mb001
3 Replies

5. Shell Programming and Scripting

XML- Sed || Awk Bash script... Help!

Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this! This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies

6. Shell Programming and Scripting

Help: How to convert this bash+awk script in awk script only?

This is the final first release of the dynamic menu generator for pekwm (WM). #!/bin/bash function param_val { awk "/^${1}=/{gsub(/^${1}="'/,""); print; exit}' $2 } echo "Dynamic {" for CF in `ls -c1 /usr/share/applications/*.desktop` do name=$(param_val Name $CF) ... (3 Replies)
Discussion started by: alexscript
3 Replies

7. Shell Programming and Scripting

How to Pass filename to AWK in bash script

I have written a script which works fine, to remove patterns contained in EXCLUDE.DAT from input.txt awk 'BEGIN {n=0;while (getline < "EXCLUDE.DAT" > 0){ex=$0;n++}} {for(var in ex){print var "-" ex $0 ;i++}}' input.txt The last problem I need to solve is how to pass the file... (3 Replies)
Discussion started by: nixie
3 Replies

8. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies

9. Shell Programming and Scripting

Bash script with awk command ERROR

Hello im new here... Im trying to read file and create folders from words in it but i get this for loop error awk : line 3 : syntax error at or near for my code is.. #!/bin/bash begin for (( i=1;i<=5;i++)); do awk -v i=$i $0 { print $i } mkdir $i done {print $i} end {} i have... (7 Replies)
Discussion started by: boxstep
7 Replies

10. Shell Programming and Scripting

Bash/awk script problem

Hi, I have 100 files containing different values in single column, I want to split those files in two separate files (file2 and file3) based on average value of first column of each file, for those files I am working on the following script #bin/bash for memb in $(seq 1 100) do awk... (4 Replies)
Discussion started by: dsp80
4 Replies
GSM(3)							     Library Functions Manual							    GSM(3)

NAME
gsm_create, gsm_destroy, gsm_encode, gsm_decode -- GSM 06.10 lossy sound compression SYNOPSIS
#include "gsm.h" gsm gsm_create(); void gsm_encode(handle, src, dst) gsm handle; gsm_signal src[160]; gsm_frame dst; int gsm_decode(handle, src, dst) gsm handle; gsm_frame src; gsm_signal dst[160]; void gsm_destroy(handle) gsm handle; DESCRIPTION
Gsm is an implementation of the final draft GSM 06.10 standard for full-rate speech transcoding. gsm_create() initializes a gsm pass and returns a 'gsm' object which can be used as a handle in subsequent calls to gsm_decode(), gsm_encode() or gsm_destroy(). gsm_encode() encodes an array of 160 13-bit samples (given as gsm_signal's, signed integral values of at least 16 bits) into a gsm_frame of 33 bytes. (gsm_frame is a type defined as an array of 33 gsm_bytes in gsm.h.) gsm_decode() decodes a gsm_frame into an array of 160 13-bit samples (given as gsm_signals), which sound rather like what you handed to gsm_encode() on the other side of the wire. gsm_destroy() finishes a gsm pass and frees all storage associated with it. Sample format The following scaling is assumed for input to the algorithm: 0 1 11 12 S..v..v..v..v..v..v..v..v..v..v..v..v..*..*..* Only the top 13 bits are used as a signed input value. The output of gsm_decode() has the three lower bits set to zero. RETURN VALUE
gsm_create() returns an opaque handle object of type gsm, or 0 on error. gsm_decode() returns -1 if the passed frame is invalid, else 0. EXAMPLE
#include "gsm.h" gsm handle; gsm_frame buf; gsm_signal sample[160]; int cc, soundfd; play() { /* read compressed data from standard input, write to soundfd */ if (!(handle = gsm_create())) error... while (cc = read(0, (char *)buf, sizeof buf)) { if (cc != sizeof buf) error... if (gsm_decode(handle, buf, sample) < 0) error... if (write(soundfd, sample, sizeof sample) != sizeof sample) error... } gsm_destroy(handle); } record() { /* read from soundfd, write compressed to standard output */ if (!(handle = gsm_create())) error... while (cc = read(soundfd, sample, sizeof sample)) { if (cc != sizeof sample) error... gsm_encode(handle, sample, buf); if (write(1, (char *)buf, sizeof buf) != sizeof sample) error... } gsm_destroy(handle); } BUGS
Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. SEE ALSO
toast(1), gsm_print(3), gsm_explode(3), gsm_option(3) GSM(3)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy