find grep sed commands homework

Use and complete the template provided. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    I have to make as home work several commands with gerp find and sed

  2. Relevant commands, code, scripts, algorithms:
    FIND command
    -use command find to display all files, such that file is usual file and display all his line with inscription "MA"

GREP comand
display user with grep command form /etc/passwd

  1. to display all login to begin and finishing with letter a or b
  Code:
  etc.users
 admina
 bserb
 broota
  1. beginning and finishing with the same sign
Code:
  etc. users
aghata:....
roootr:....
  1. to contain what the least three identical signs standing by me
Code:
  etc. users
 rooot:.....
admmmin:.....
ussser...
  1. it including five signs which was can read backwards
Code:
  etc. users
      Do geese see God?  ->  do Geese see goD
      Devil lived   -> devil liveD

SED comand

  1. replace multiple the pronouncement of any sign one such sign
 Code:
  etc. jfaghkjfhadglkjaaaadfgdffffffdddttttmmmm
      jfaghkjfhadglkjadfgdfdttm
  1. replace every the pronouncement of sign aaaa bbb only and or only b

  2. The attempts at a solution (include all code and scripts):
    In find i try find . -type f -exec grep -l MA {} \;

  3. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    Nicolaus Copernicus University
    Torun, Poland
    professor Zyglarski Bazej
    sk1-cw2
    Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

1 Like

I'll do this one for you.

$ grep '\([a-z]\)\([a-z]\)\([a-z]\)\([a-z]\)\([a-z]\).*\5\4\3\2\1' text
orizabus subaziro:ljjljlkjlk:roota:jkjhkjhk

"orizabus subaziro" besides being a palindrome is the real scientific name for some kind of insect.

1 Like

Who want make more ?

Your point?

Make more what, exactly?

You want everyone just to give you all the answers?

What would you learn from that?

@unix.com admin
Is there a link to post #1 in the original language?

How are you viewing this page? It looks to be in the original language to me.

@scottn The sentences read like they have been translated from another language.

@ViruS89

  1. it including five signs which was can read backwards

Some ideas for detecting a palindrome based on your example.

var1="Do geese see God"
var2="do Geese see goD"
echo "var1=${var1}"
echo "var2=${var2}"
echo ""
# Use the "tr" command to change upper case to lower case and remove spaces
var1_lower=`echo "${var1}"|tr 'A-Z' 'a-z'|tr -d ' '`
var2_lower=`echo "${var2}"|tr 'A-Z' 'a-z'|tr -d ' '`
echo "var1_lower=${var1_lower}"
echo "var2_lower=${var2_lower}"
echo ""
# Use the "rev" command to reverse the string
var2_lower_rev=`echo "${var2_lower}"|rev`
echo "var2_lower_rev=${var2_lower_rev}"
echo ""
if [ "${var1_lower}" = "${var2_lower_rev}" ]
then
        echo "This is a Palindrome"
else
        echo "This is not a Palindrome"
fi


var1=Do geese see God
var2=do Geese see goD

var1_lower=dogeeseseegod
var2_lower=dogeeseseegod

var2_lower_rev=dogeeseseegod

This is a Palindrome

@methyl: Probably from Polish - by the O/P. A language translation would also have translated other parts of the post (the homework template headings, etc.), which are clearly not translated.