How can I text my phone from Bash?












2














I've just lost my phone. I know it's here in my house cause I used it last night and my bluetooth speakers will connect to it this morning.



How can I text my phone using bash? Then the phone notification will sound and I can find my phone.



Note: I asked for a bash solution because it's simpler to implement and works from Windows 10 (within WSL) without modification. Other users will appreciate non-bash solutions. So feel free to post other solutions.










share|improve this question



























    2














    I've just lost my phone. I know it's here in my house cause I used it last night and my bluetooth speakers will connect to it this morning.



    How can I text my phone using bash? Then the phone notification will sound and I can find my phone.



    Note: I asked for a bash solution because it's simpler to implement and works from Windows 10 (within WSL) without modification. Other users will appreciate non-bash solutions. So feel free to post other solutions.










    share|improve this question

























      2












      2








      2


      2





      I've just lost my phone. I know it's here in my house cause I used it last night and my bluetooth speakers will connect to it this morning.



      How can I text my phone using bash? Then the phone notification will sound and I can find my phone.



      Note: I asked for a bash solution because it's simpler to implement and works from Windows 10 (within WSL) without modification. Other users will appreciate non-bash solutions. So feel free to post other solutions.










      share|improve this question













      I've just lost my phone. I know it's here in my house cause I used it last night and my bluetooth speakers will connect to it this morning.



      How can I text my phone using bash? Then the phone notification will sound and I can find my phone.



      Note: I asked for a bash solution because it's simpler to implement and works from Windows 10 (within WSL) without modification. Other users will appreciate non-bash solutions. So feel free to post other solutions.







      command-line bash windows-subsystem-for-linux sms






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 51 mins ago









      WinEunuuchs2Unix

      42.1k1070159




      42.1k1070159






















          1 Answer
          1






          active

          oldest

          votes


















          3

















          textbelt.com to send text from bash



          After some digging I found a redit article that suggested creating this function in ~/.bashrc:



          find-phone() {
          curl -X POST https://textbelt.com/text
          --data-urlencode phone='7801234567'
          --data-urlencode message='Find Your Phone!'
          -d key=textbelt
          }


          Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.



          Note: After you add a function to ~/.bashrc you must reload it. The safest route is to close your terminal and reopen it. The quick and dirty method often mentioned is to resource it using: source ~/.bashrc or . ~/.bashrc commands.





          Only one text per day



          You can only run the script once a day so have all ears tuned for your cell phones notification sound:



          $ find-phone
          {"success":true,"textId":"168141545572031481","quotaRemaining":0}

          $ find-phone
          {"success":false,"error":"Only one test text message is allowed per day.","quotaRemaining":0}




          Script enhancements



          Consider enhancing the script by:




          • Replacing phone number (7801234567) with $1.

          • Replacing Find Your phone! message with $2.

          • Getting text key from vendor (linked above).

          • Rename find-phone to more generic name sms.

          • Then you would send text using sms $phone_number $text_message






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1104017%2fhow-can-i-text-my-phone-from-bash%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3

















            textbelt.com to send text from bash



            After some digging I found a redit article that suggested creating this function in ~/.bashrc:



            find-phone() {
            curl -X POST https://textbelt.com/text
            --data-urlencode phone='7801234567'
            --data-urlencode message='Find Your Phone!'
            -d key=textbelt
            }


            Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.



            Note: After you add a function to ~/.bashrc you must reload it. The safest route is to close your terminal and reopen it. The quick and dirty method often mentioned is to resource it using: source ~/.bashrc or . ~/.bashrc commands.





            Only one text per day



            You can only run the script once a day so have all ears tuned for your cell phones notification sound:



            $ find-phone
            {"success":true,"textId":"168141545572031481","quotaRemaining":0}

            $ find-phone
            {"success":false,"error":"Only one test text message is allowed per day.","quotaRemaining":0}




            Script enhancements



            Consider enhancing the script by:




            • Replacing phone number (7801234567) with $1.

            • Replacing Find Your phone! message with $2.

            • Getting text key from vendor (linked above).

            • Rename find-phone to more generic name sms.

            • Then you would send text using sms $phone_number $text_message






            share|improve this answer




























              3

















              textbelt.com to send text from bash



              After some digging I found a redit article that suggested creating this function in ~/.bashrc:



              find-phone() {
              curl -X POST https://textbelt.com/text
              --data-urlencode phone='7801234567'
              --data-urlencode message='Find Your Phone!'
              -d key=textbelt
              }


              Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.



              Note: After you add a function to ~/.bashrc you must reload it. The safest route is to close your terminal and reopen it. The quick and dirty method often mentioned is to resource it using: source ~/.bashrc or . ~/.bashrc commands.





              Only one text per day



              You can only run the script once a day so have all ears tuned for your cell phones notification sound:



              $ find-phone
              {"success":true,"textId":"168141545572031481","quotaRemaining":0}

              $ find-phone
              {"success":false,"error":"Only one test text message is allowed per day.","quotaRemaining":0}




              Script enhancements



              Consider enhancing the script by:




              • Replacing phone number (7801234567) with $1.

              • Replacing Find Your phone! message with $2.

              • Getting text key from vendor (linked above).

              • Rename find-phone to more generic name sms.

              • Then you would send text using sms $phone_number $text_message






              share|improve this answer


























                3












                3








                3









                textbelt.com to send text from bash



                After some digging I found a redit article that suggested creating this function in ~/.bashrc:



                find-phone() {
                curl -X POST https://textbelt.com/text
                --data-urlencode phone='7801234567'
                --data-urlencode message='Find Your Phone!'
                -d key=textbelt
                }


                Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.



                Note: After you add a function to ~/.bashrc you must reload it. The safest route is to close your terminal and reopen it. The quick and dirty method often mentioned is to resource it using: source ~/.bashrc or . ~/.bashrc commands.





                Only one text per day



                You can only run the script once a day so have all ears tuned for your cell phones notification sound:



                $ find-phone
                {"success":true,"textId":"168141545572031481","quotaRemaining":0}

                $ find-phone
                {"success":false,"error":"Only one test text message is allowed per day.","quotaRemaining":0}




                Script enhancements



                Consider enhancing the script by:




                • Replacing phone number (7801234567) with $1.

                • Replacing Find Your phone! message with $2.

                • Getting text key from vendor (linked above).

                • Rename find-phone to more generic name sms.

                • Then you would send text using sms $phone_number $text_message






                share|improve this answer

















                textbelt.com to send text from bash



                After some digging I found a redit article that suggested creating this function in ~/.bashrc:



                find-phone() {
                curl -X POST https://textbelt.com/text
                --data-urlencode phone='7801234567'
                --data-urlencode message='Find Your Phone!'
                -d key=textbelt
                }


                Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.



                Note: After you add a function to ~/.bashrc you must reload it. The safest route is to close your terminal and reopen it. The quick and dirty method often mentioned is to resource it using: source ~/.bashrc or . ~/.bashrc commands.





                Only one text per day



                You can only run the script once a day so have all ears tuned for your cell phones notification sound:



                $ find-phone
                {"success":true,"textId":"168141545572031481","quotaRemaining":0}

                $ find-phone
                {"success":false,"error":"Only one test text message is allowed per day.","quotaRemaining":0}




                Script enhancements



                Consider enhancing the script by:




                • Replacing phone number (7801234567) with $1.

                • Replacing Find Your phone! message with $2.

                • Getting text key from vendor (linked above).

                • Rename find-phone to more generic name sms.

                • Then you would send text using sms $phone_number $text_message







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 30 mins ago

























                answered 51 mins ago









                WinEunuuchs2Unix

                42.1k1070159




                42.1k1070159






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1104017%2fhow-can-i-text-my-phone-from-bash%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Contact image not getting when fetch all contact list from iPhone by CNContact

                    count number of partitions of a set with n elements into k subsets

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks