BASH Palindrome Checker

前端 未结 5 1919
[愿得一人]
[愿得一人] 2021-01-24 19:14

This is my first time posting on here so bear with me please.

I received a bash assignment but my professor is completely unhelpful and so are his notes.

Our assig

5条回答
  •  悲哀的现实
    2021-01-24 19:36

    Ok here is something to get you started:

    I suggest to use the plan you have above, just generate the number of "." using a for loop.

    This question will explain how to make a for loop from 3 to 45:

    How do I iterate over a range of numbers defined by variables in Bash?

    for i in {3..45}; 
    do 
       * put your code above here *
    done
    

    Now you just need to figure out how to make "i" number of dots "." in your first grep and you are done.

    Also, look into sed, it can nuke the non-lowercase answers for you..

提交回复
热议问题