File: get_lsm_entry.sh

package info (click to toggle)
kwave 0.7.2-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,048 kB
  • ctags: 4,906
  • sloc: cpp: 31,275; ansic: 13,111; sh: 9,511; perl: 2,724; makefile: 786; asm: 145
file content (23 lines) | stat: -rwxr-xr-x 527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# get_lsm_entry - gets the value of an entry in an lsm file
# 
# 05.03.2000 by Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>
#
# parameters:
# stdin 
# $1 full path to the lsm file
# $2 name of the lsm entry
#
# NOTE: this should be regarded to be a quick hack, only few error checking 
#       is performed !!!

# uncomment this for debugging
# set -x

cat $1 | awk -v field=$2: ' \
    { p=index($0, field) } \
    { if (p==1) print substr($0,length(field)+1) }' | sed s/^\[\ \]\*//g 

# | awk '{ print $1 }'