How to create a mysql stored procedure through linux terminal
There is no way around it. You must use the DELIMITER command. Why ?

If you ever perform a mysqldump of the stored procedures, each stored procedure begins with

DELIMITER ;;


and ends with 

DELIMITER ;


Here is a post where I mentioned this before : DROP PROCEDURE IF EXISTS not included in mysqldump

Try dumping one stored procedure with mysqldump and see for yourself

I also wrote some code to do this:


how to dump a single stored procedure from a database
Dump only the Stored Procedures in MySQL


As for the answer posted by @altmannmarcelo, it directly answers your question (+1 for his answer). Otherwise, mysqldumps could never restore stored procedures.

There are two things you can do to accommodate a new DELIMITER:

TRY THIS #1

Give the delimiter on the command line itself

mysql -u root -pmypass --delimiter="//" test &lt; myproc.sql


It is a command line option for the mysql client program

[root@****]# mysql --help | grep -i delimiter
  --delimiter=name    Delimiter to be used.
delimiter                         ;


TRY THIS #2

You can write the code into a text file and execute against the text file as @altmannmarcelo suggested

echo "DELIMITER //" &gt; myproc.sql
echo "create procedure test_pro()" &gt;&gt; myproc.sql
echo "begin" &gt;&gt; myproc.sql
echo "select 'hello pro';" &gt;&gt; myproc.sql
echo "end" &gt;&gt; myproc.sql
echo "//" &gt;&gt; myproc.sql
mysql -u root -pmypass  test &lt; myproc.sql


GIVE IT A TRY !!!