10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
2. Shell Programming and Scripting
Hi Gurus,
I need a script to compare two files: sample file like below:
list:
cde,file4
cde,file5
def,file6
def,file7
def,file8
abc,file1
abc,file2
abc,file3
acd,file9
acd,file10
tmp
file1
file2
file3
file4 (12 Replies)
Discussion started by: ken6503
12 Replies
3. Shell Programming and Scripting
Main_script.sh
#! /bin/sh
./Sub_script.sh
rc=$?
echo "Return code from Sub_script.sh : $rc"
if ; then
echo "$rc = 991"
echo ""
exit 1
elif ; then
echo "$rc = 992"
echo ""
exit 1
elif ; then
echo "$rc = 0"
echo ""
exit 1
fi (2 Replies)
Discussion started by: duddukuri
2 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
Using grep command, i want to find the pattern of text in all directories and sub-directories.
e.g: if i want to search for a pattern named "parmeter", i used the command
grep -i "param" ../*
is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies
5. Shell Programming and Scripting
Hello,
Thanks in advance for the query.
There is a log file abcd.log which has multible line like this.
"hello1" , "hello2", "hello3" , "hello4" , "hello5"
I want to grep for the lines which has "hello4" & "hello5" and use "hello2" to grep the same log file again.
All these should... (8 Replies)
Discussion started by: kzenthil
8 Replies
6. Shell Programming and Scripting
Hi,
I have a problem that I am sure someone will know the answer to. Currently I have a script which returns a binary output if it finds a certain search string (in this case relating to a DRBD cluster) as follows:
searchstring="cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate"
&& echo... (3 Replies)
Discussion started by: almightybunghol
3 Replies
7. Solaris
I have a sun4u system running Solaris 8. I tried running the df command but it returns a blank result. Also I'm unable to collect an explorer from this system as the OS complains that the disk is full. What could be going on here? (10 Replies)
Discussion started by: dperry1973
10 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I looking to use grep to return a string with exactly n matches.
I'm building off this:
ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '
-rwxr-xr-x 1 root root 632816 Nov 25 2008 vi
-rwxr-xr-x 1 root root 632816 Nov 25 2008 view
-rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies
9. Shell Programming and Scripting
Hi All,
I amlearning UNIX scripting. I have a small query. I would be thankful if any one helps me out.
I have a below piece of code which delets the files. If file dosent have the permissions to delete a particular file I have used 2>>operator to track the error code.
But my objective is... (1 Reply)
Discussion started by: manas6
1 Replies
10. Shell Programming and Scripting
hello,
iostat -En | grep Vendor | grep -v DV | awk '{print $1 $2}' | sort -u
returns
Vendor:HP
I want to append Disk to it. i.e.:
Disk Vendor:HP
how to do that?
thanks (8 Replies)
Discussion started by: melanie_pfefer
8 Replies