10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi,
I have variable called fname that has the value M201401151630_P008949.csv.txt
I need to grep and store this in a variable called prcid for the number before ".csv" and the letter "P" excluding all zeros in the beginning.
Desired output 8949
Likewise for M201401151630_P108949.csv.txt... (12 Replies)
Discussion started by: mohtashims
12 Replies
3. Shell Programming and Scripting
ps -ef |grep /usr/sbin/qdaemon
root 5034194 385266 0 Oct 26 - 1:57 /usr/sbin/qdaemon
root 7639132 2523220 0 15:25:58 pts/10 0:00 grep /usr/sbin/qdaemon
ps -ef |grep /usr/sbin/qdaemon |wc
2 18 145
I need to send out e-mail if the count of the lines... (9 Replies)
Discussion started by: Daniel Gate
9 Replies
4. UNIX for Dummies Questions & Answers
which one of the following is the correct expression to ignore line with multiple spaces after any string
cat file | grep -v "xyz *$"
or
cat file | grep -v "xyz*$"
do i need "*" to specify the sapce or " *" will do? (2 Replies)
Discussion started by: manishma71
2 Replies
5. Shell Programming and Scripting
Dear All,
I plan to write a script and in the beginning, I will check if there's any existing previous process running, if YEs, then exit directly, if Not, then continue.
#!/bin/bash
NUM=`ps -ef | grep $0 | grep -v grep | wc -l`
ps -ef | grep $0 | grep -v grep
echo "NUM ==> $NUM"
if... (6 Replies)
Discussion started by: tiger2000
6 Replies
6. UNIX for Dummies Questions & Answers
I have a data file that is arranged like this:
Marketing Ranjit Singh Eagles Dean Johnson FULL
Marketing Ken Whillans Eagles Karen Thompson FULL
Sales Peter RobertsonGolden TigersRich Gardener PART
President Sandeep Jain Wimps Ken Whillans CONT... (7 Replies)
Discussion started by: hitman247m
7 Replies
7. Shell Programming and Scripting
Hi,
I want to search for a return code of -3. Using grep "-3" *.* is giving a syntax error. Please suggest as to how can we search for this pattern using grep.
Thanks,
Krishna (2 Replies)
Discussion started by: kzmatam
2 Replies
8. UNIX for Dummies Questions & Answers
File1.txt
.......
.......
OMC LA
OMC LK
OMC LS
........
........
Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2..
omc_ident="OMC LA" or "OMC LK" or "OMC LS"
omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Discussion started by: neruppu
4 Replies
9. UNIX for Dummies Questions & Answers
I am given a file with a list of names for the first 20 characters. The 20 characters after is a list of names that somebody is supposed to team up with.
Now i'm trying to write a simple script that will read a name somebody inputs and then looks only in the first 20 characters.
For example.... (2 Replies)
Discussion started by: MaestroRage
2 Replies
10. Shell Programming and Scripting
Hi,
I have multiple files where it starts with test1.c, test2.c,test3.c and so on.
I would like to get each file separately to perform abstraction from these files.
I tried something like:-
for t in ./*
filenumber=${t:4} # to cut the "test" in order to get the number
cat... (3 Replies)
Discussion started by: ahjiefreak
3 Replies