10 More Discussions You Might Find Interesting
1. OS X (Apple)
cat file
1 aaa
2 bbb
3 ccc
4 ddd
In TextEdit, I then copy the characters “ccc” to the clipboard. The problem is that the following command gives no output:
bash-3.2$ pbpaste | grep - file
Desired output:
3 ccc
What should the syntax be for that command? I am using MacOS El... (3 Replies)
Discussion started by: palex
3 Replies
2. Shell Programming and Scripting
So, this is weird... I'm running this command:
iotop -o -P -k -bt -d 5
I'd like to save the output relelvant to rsyslogd to a file, so I do this:
iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd
Nothing is written to the file! I can write the full output to the file:
... (2 Replies)
Discussion started by: treesloth
2 Replies
3. Shell Programming and Scripting
I am trying to extract the file names alone, for example "TVLI_STATS_NRT_XLSTWS03_20120215_132629.csv", from below output
which was given by the grep.
sam:/data/log: grep "C10_Subscribe.000|subscribe|newfile|" PDEWG511_TVLI_JOB_STATS.ksh.201202*
Output:
... (6 Replies)
Discussion started by: siteregsam
6 Replies
4. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (6 Replies)
Discussion started by: frymor
6 Replies
5. Ubuntu
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (1 Reply)
Discussion started by: frymor
1 Replies
6. Shell Programming and Scripting
Hello,
I trying to extract text that is surrounded by xml-tags. I tried this
cat tst.xml | egrep "<SERVER>.*</SERVER>" |sed -e "s/<SERVER>\(.*\)<\/SERVER>/\1/"|tr "|" " "
which works perfect, if the start-tag and the end-tag are in the same line, e.g.:
<tag1>Hello Linux-Users</tag1>
... (5 Replies)
Discussion started by: Sebi0815
5 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I need to use a double grep so to speak. I need to grep for a particular item say BOB and then for each successful result I need to grep for another item say SMITH.
I tried grep "BOB" filename | grep "SMITH"
but it does not seem to work.
I can achieve my desired result using an... (12 Replies)
Discussion started by: mojoman
12 Replies
8. Shell Programming and Scripting
STEP 1
# Set variable
FILE=/tmp/mainfile
SEARCHFILE =/tmp/searchfile
# THIS IS THE MAIN FILE.
cat /tmp/mainfile
Interface Ethernet0/0 "outside", is up, line protocol is up
Hardware is i82546GB rev03, BW 100 Mbps
Full-Duplex(Full-duplex), 100 Mbps(100 Mbps)
MAC address... (6 Replies)
Discussion started by: irongeekio
6 Replies
9. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies
10. Shell Programming and Scripting
Dear all,
I am reading a file that has 1 column. While reading I must find the line references from the another file. The following shell doesn't works.
Please help
#!/bin/bash
while read filename; do
grep ${filename} fs_full.dat >> unprocfull.dat;
done < unproc.dat
But when... (2 Replies)
Discussion started by: mr_bold
2 Replies