10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases?
This would seem to involve find, xargs, *grep, regex, etc.
In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies
2. Shell Programming and Scripting
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Discussion started by: pstein
5 Replies
3. Shell Programming and Scripting
Hi all ,
I'm new to unix
I have a checked project , there exists a file called xxx.config .
now my task is to find all the files in the checked out project which references to this xxx.config file.
how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies
4. Shell Programming and Scripting
Hi
Following is an example line.
echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:"
I want it's output to be
200
However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Discussion started by: shahanali
3 Replies
5. Shell Programming and Scripting
Hi,
I have a shell script that reads a parameter file to set variables. I have an issue when the parameter I try to read contains whitespace.
e.g
File Contents
Code
The result is SUBJECT is set to
and I want subject set to
I've tried different variations but nothing seems to... (19 Replies)
Discussion started by: Greygor
19 Replies
6. UNIX for Advanced & Expert Users
I have a single string as below:
Rat run after Cat
i.e. there is a single whitespace after Cat.
This causes my file to fail.
Is there a way I can remove any whitespace at the end of any string.
I tried sed 's/ *//g', but it removes all white space and the above string becomes... (10 Replies)
Discussion started by: RubinPat
10 Replies
7. Shell Programming and Scripting
Hi,
Say I have this text file <copy.out> that contains a list of files/directories to be copied out to a different location.
$ more copy.out
dir1/file1
dir1/file2
dir1/file3
"dir1/white space"
dir1/file4
If I do the following:
$copy=`more copy.out`
$echo $copy
dir1/file1... (4 Replies)
Discussion started by: 60doses
4 Replies
8. Shell Programming and Scripting
HI Friends,
Traxlist.txt --this is my file contains this txt
-------------
108042708190000.txt
108042708190001.txt
112040108174516.txt
112042708173000.txt
112042708174508.txt
112050108173000.txt
113042708100500.txt
113042708103026.txt
i have varible called... (3 Replies)
Discussion started by: kittusri9
3 Replies
9. UNIX for Advanced & Expert Users
Hai
I am using
bash-2.03$ bash --version
GNU bash, version 2.03.0(1)-release (sparc-sun-solaris)
I am not able to use gawk command its showing command not found , why ?
Eg:
awk 'NR==1' fix.txt | gawk 'BEGIN { FIELDWIDTHS = "3 2" } { printf($1"|"$2); }'... (8 Replies)
Discussion started by: tkbharani
8 Replies
10. UNIX for Dummies Questions & Answers
When I enter the command below grep appears to be returning a file it shouldn't.
find . -name "*.*" -exec grep "testing" {} /dev/null \;
.:ops3Mailfile
./SSI.ksh: # create TECHOUT dummy for test for testing purposes
./ftprimi1.ksh:# before running job in prod... change FTP to... (1 Reply)
Discussion started by: dfb500
1 Replies