12-05-2007
Show result only if number is greater then
Hello all
Im trying to write one liner that will show me results only if the result of the expression is greater then 0
For example:
I do :
PHP Code:
find . -name "*.dsp" | xargs grep -c SecurityHandler
the result are :
./foo/blah/a.dsp:0
./foo/blah1/b.dsp:1
./foo/blah2/c.dsp:2
./foo/blah3/d.dsp:0
Now I like to print only dsp's that the word " SecurityHandler" is more then 0
How can it be done?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all
say i like to find files i do :
find . -name "*.txt"
but if i like to find ( and print out ) only the path's where the files are ( the *.txt files )
what can i add to the find command ? (1 Reply)
Discussion started by: umen
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
In my code I am checking to see if a variable that contains a decimal number is greater than 0 in the following manner:
if
do something
fi
However I am getting the error message (if $i for the current iteration holds 9.6352)
command 9.6352 is not found
How can I rectify... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies
3. Shell Programming and Scripting
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
grep -c . sample.txtor
wc -l < sample.txt or
awk 'END {print NR}' sample.txtAll these commands shows the count as 1, which means they are reading only the first header line of the file.... (3 Replies)
Discussion started by: mehar
3 Replies
4. Shell Programming and Scripting
data:
hello mr smith 400 you all ok?
hello mrs. smith 700 you all ok?
hello mr. everyone 150 you all ok?
hello mr. you all 199 im lad you are ok
using egrep, how can i grep out only lines that have a number greater than 250?
cat data | egrep .....
can't use awk here. i was... (7 Replies)
Discussion started by: SkySmart
7 Replies
5. Shell Programming and Scripting
i'm aware awk can do what i'm trying to do here. but i cant use awk in this scenario given the circumstance of this box.
but i need to check if a number is a certain column is over a certain value, say for instance, 20.
data:
| 12 | 19 | 2000 | 9029333 |... (11 Replies)
Discussion started by: SkySmart
11 Replies
6. Shell Programming and Scripting
Hello,
I am newbie to bash scripting. Could someone help me with the following.
I have log file with output as shown below
**************************LOG*************************
11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data:
11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Discussion started by: meena_2013
4 Replies
7. Shell Programming and Scripting
Hi,
I've got as far as this: awk '{sum+=$1}(NR%3==1){avg=sum/3; print avg}' input.txt
Input it:
0.1
txt
txt
0.2
txt
txt
0.3
txt
txt
So, the I get the results:
0.0333333
0.133333
0.2 (8 Replies)
Discussion started by: JohnnyEnglish
8 Replies
8. UNIX for Dummies Questions & Answers
please let me know how to construct if then else by comparing two numbers if it is greater than 10000. I need to do some specific task executed.
can you help me out in shell scripting plz. (6 Replies)
Discussion started by: ramkumar15
6 Replies
9. Shell Programming and Scripting
Hi everyone,
I have two question
1- I want to execute command in shell and after execution result show in a web server. (kind of making UI )
e.g.
in shell
root ~: show list
item1
item2
item(n)in web server
in a page draw a table and show those items in itno | name... (1 Reply)
Discussion started by: indeed_1
1 Replies
10. Shell Programming and Scripting
Hello.
I am comparing two binary file.
The first file is the source file. The second file is a modified version of the first one.
Modification concern uuid value.
Example
first file have multiple occurrences of 69a3604b-ac2b-43b7-af84-0a4a67fc6962 second file have the same occurence... (1 Reply)
Discussion started by: jcdole
1 Replies
7(16 December 2012) 7(16 December 2012)
NAME
dsp - Open Sound System audio devices
DESCRIPTION
/dev/dsp is the default audio device in the system. It's connected to the main speakers and the primary recording source (such as micro-
phone). The system administrator can set /dev/dsp to be a symbolic link to the desired default device. The ossinfo utility can be used to
list the available audio devices in the system.
/dev/dsp_mmap, /dev/dsp_ac3, /dev/dsp_multich and /dev/dsp_spdifout are default audio devices for specific applications such as games or
media (DVD) players.
DIRECT ACCESS AUDIO DEVICE FILES
OSS 4.0 (and later) will create audio devices under /dev/oss/<device> directory. For example /dev/oss/sblive0/pcm0 is the first audio
device that belongs to the first Sound Blaster Live! or Audigy card in the system. These direct devices are used when an application needs
to access specific audio device (instead of the default one).
You can use the ossinfo(1) utility with the -a option to get a list of the available audio devices in the system.
LEGACY AUDIO DEVICE FILES
Traditionally OSS has created device files like /dev/dsp0 to /dev/dspN for each audio device in the system. OSS 4.0 still supports this
legacy naming. These files are symbolic links to the actual device files located under /dev/oss. The ossdevlinks(8) utility is used to
manage these links and it will be automatically invoked when OSS is started.
COMPATIBILITY
o The /dev/dsp (default() audio device file will be supported by all OSS implementations and versions.
o The special purpose audio default devices (such as /dev/dsp_mmap) are only supported by OSS 4.0 and later.
o The legacy audio device files (such as /dev/dsp1) are supported by all OSS versions and implementations.
o New style audio device files (under /dev/oss) are only supported by OSS 4.0 and later. However some independent OSS implementations may
only support the legacy naming even they are otherwise OSS 4.0 compatible.
o /dev/dsp0 doesn't exist in all Linux systems which use /dev/dsp for the same purpose. In such systems /dev/dsp points to the first audio
device and /dev/dsp1 to the second.
PROGRAMMING INFORMATION
See the Audio Programming section of the OSS Programmer's Guide (DSP(2)) for more info.
OPTIONS
None
FILES
o /dev/dsp
Default audio device
o /dev/dsp_mmap
Default audio device for applications using mmap(2)
o /dev/dsp_ac3
Default audio device for applications sending Dolby Digital (AC3) audio to an external receiver.
o /dev/dsp_multich
Default multichannel (4.0-7.1) audio output device
o /dev/dsp_spdifout
Default digital audio (S/PDIF) output device
o /dev/oss/<driver>/pcmN
Direct access device files for individual audio devices.
o /dev/dsp0 to /dev/dspN
Legacy style direct access audio device files.
AUTHOR
4Front Technologies
OSS Devices 7(16 December 2012)