After Learning Shell Scripting

Will it be good to learn 1) Perl or 2) Ruby first?

Both of them would be good for you to learn. The order which you learn it will be up to you. If you are looking for some influence to make your decision, consider these:
Perl has a great hold in the administration of Unix and Unix-like systems. However, Perl OOP (Object Orientate Programming) was an evolution or after thought and some might say, clunky.
Ruby can replace Perl in the administration of a system. Many of the same ideas in Perl you find them in Ruby but converted to OOP. I like to think of Ruby as a reinvention of Perl with OOP in mind.

There is no "best", there is only what fits your skills and needs. If you are actually proficient with any shell you will already understand a lot of programming concepts - loops, redirection, conditional branches, error handling - for example.

So, learning either one is good. perl is much more like shell, easier to learn from that perspective. ruby is an excellent language but there are some foreign concepts in there relative to shell scripting.

BTW, you can do one heck of a lot of programming with a modern shell. Some shells directly support floating point arithmetic operations - like ksh93.

I would really really concentrate hard on shell scripting, regular expressions, awk, and sed. That will get you pretty far. Wait for other languages.

IMHO, I get a lot of use out of scripting with Bash. I have written most of my shell scripts with Bash. I also do Perl programming. I mostly do Perl because it is a requirement for my job. I don't like that it is loosely typed, doesn't handle NULL very well and the error handling is terrible. Perhaps Python or Ruby would do a better job. But you can get a lot done with Bash.