10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a large CSV file that contains values all on the same column, and in one very long row (e.g. no line breaks till end, with all data values separated by a comma).
The file has two types of data for the values. One begins with the letters rs and some numbers. The other begins... (4 Replies)
Discussion started by: macurdy
4 Replies
2. Shell Programming and Scripting
Hi Team(Solaris 5.8/Ksh),
How can we save grep output to awk variable when grep returns more than one line or word.
abc.log
# more abc.log
Hi Makarand
How r u
bye Makarand
Hello
when grep returns only 1 word below command works
nawk -v var=`cat abc.log |grep "Hello"` 'BEGIN { if... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies
3. Shell Programming and Scripting
Hi Experts,
- Getting error while using it through a variable to get the PID,
PID=42
# UNIX95=1 ps -e -o pcpu,pid,ppid,stime,etime,args | awk '{if ($2~"^42$") print $0}'
0.00 42 0 Feb 10 600-17:21:29 nfs_async_io
- But when using with a variable it is not working .
#... (6 Replies)
Discussion started by: rveri
6 Replies
4. Shell Programming and Scripting
Hello,
it would be great if someone can help me with the following:
I want to search for the rows from fileA in column 1 of fileB and output column 2 of fileB if found in fileC. In the moment I search within the complete file. How can I change the code so only column 1 is searched?
cat fileA... (7 Replies)
Discussion started by: Manyaka
7 Replies
5. Shell Programming and Scripting
Hi there. I have a very large file and I am trying to format it so that I can pull out certain pieces of data/info and report it in spreadsheet format/style.
The file has ###### which will separate each line that will be listed in the spreadsheet. Whenever I find "No" at the end of a line I want... (7 Replies)
Discussion started by: kieranfoley
7 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
Please i need to know the difference between grep, egrep & grep -i when used to serach through a file.
My platform is SunOS 5.9 & i'm using the korn shell.
Regards,
- divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies
7. Shell Programming and Scripting
This script is supposed to find out if tomcat is running or not.
#!/bin/sh
if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null
then
echo Tomcat for $1 running
else
echo Tomcat for $1 NOT running
fi
the /tomcat/bases is a file that... (2 Replies)
Discussion started by: ziggy25
2 Replies
8. Shell Programming and Scripting
Dear All,
I have a command which gives the number of fields of each line of a comma-separated file.
sthng like this :
cat QDB_20071126_002.bad | awk -F"," '{ print NF }'
I need to assign the first output and the last output of the above command to variables in a script.
Need help to do... (4 Replies)
Discussion started by: KrishnaSaran
4 Replies
9. UNIX for Dummies Questions & Answers
Hi,
The input file "notifications" contains the following string.
FRTP has 149 missing batches
I want to search for :
FRTP has missing batches
As the number 149 is not important and will change.
The commands I have tried.
grep "FRTP has.*missing batches" notifications.txt... (3 Replies)
Discussion started by: whugo
3 Replies
10. Shell Programming and Scripting
Somebody can please give a highlight on this. The problem shows only on Linux(Redhat) not any other unix flavors
:confused:
Linux :
$unset m
$m=`find . -newer rman_padev_20051206195000.out -name "*L0.rman" -exec ls -l {} \; | awk '{ s+=$5 } END{printf("%.0f", s)}'`
$echo $m
7425089536... (0 Replies)
Discussion started by: prathom
0 Replies