String
Posted on 8th February 20101 Comment
In Unix, How Do I Search For Every Occuence Of A String With Sed?

I want to find every occurence of a string.
I have:
!#/bin/sh
sed “/”$1″/!d” [filename]
This works if the command line argument matches a string exactly without any extra characters. But what I want to do is find every occurence of the string, even if it is in the middle of the word, at the end of [...]

Read More
Posted on 8th February 20103 Comments
Regexing The Dictionary File In Unix?

How would one write a REGEX to grep the ‘words’ file to find the longest word in its dictionary? Or rather how would write the REGEX to search for a 15 character long [:alpha:] string? Or 50 character long string? Thank you.

Read More
Posted on 27th November 20091 Comment
How To Convert From Lowercase To Uppercase In Unix Without Using Functions?

I’m not quite sure what you want to do (convert an entire string or just a single character).
And i assume by ‘without using fuctions’ you don’t want to do any actual programming…
If you want to convert a whole string from lower to upper you can use tr.
echo ‘HeLlO’ | tr ‘[a-z]‘ ‘[A-Z]‘
this will echo HELLO
if [...]

Read More
Posted on 3rd September 20091 Comment
Is There A Way To Serch Every File In Unix For Just One String?

The string in particular I am looking for is ‘rebooted (eom)’. I need to find the file name in Unix that contains that certain string. I don’t know what directory the file is in, but the it generates an email every time the box reboots with that in the subject.

Read More
Posted on 23rd August 20092 Comments
Improve the web with Nofollow Reciprocity.