Как проверить непрочитанные письма Gmail из командной строки

curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/\(.*\)\(.*\).*/\2 - \1/p"</code></p> <hr> <p>Эта команда использует <code>curl</code> для получения данных о непрочитанных письмах Gmail через API. Затем она обрабатывает и форматирует эту информацию, выводя список непрочитанных писем с именем отправителя и темой письма.</p> </div> <div class="ct-share-box" data-location="bottom" data-type="type-1" > <div data-icons-type="simple"> <a href="http://vk.com/share.php?url=https%3A%2F%2Fclihacks.ru%2Favtomatizacziya-i-skripty%2F14241%2F&title=%D0%9A%D0%B0%D0%BA%20%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B8%D1%82%D1%8C%20%D0%BD%D0%B5%D0%BF%D1%80%D0%BE%D1%87%D0%B8%D1%82%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5%20%D0%BF%D0%B8%D1%81%D1%8C%D0%BC%D0%B0%20Gmail%20%D0%B8%D0%B7%20%D0%BA%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D0%BD%D0%BE%D0%B9%20%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8" data-network="vk" aria-label="VK" rel="noopener noreferrer nofollow" > <span class="ct-icon-container" > <svg width="20px" height="20px" viewBox="0 0 20 20" aria-hidden="true"> <path d="M19.2,4.8H16c-0.3,0-0.5,0.1-0.6,0.4c0,0-1.3,2.4-1.7,3.2c-1.1,2.2-1.8,1.5-1.8,0.5V5.4c0-0.6-0.5-1.1-1.1-1.1H8.2C7.6,4.3,6.9,4.6,6.5,5.1c0,0,1.2-0.2,1.2,1.5c0,0.4,0,1.6,0,2.6c0,0.4-0.3,0.7-0.7,0.7c-0.2,0-0.4-0.1-0.6-0.2c-1-1.4-1.8-2.9-2.5-4.5C4,5,3.7,4.8,3.5,4.8c-0.7,0-2.1,0-2.9,0C0.2,4.8,0,5,0,5.3c0,0.1,0,0.1,0,0.2C0.9,8,4.8,15.7,9.2,15.7H11c0.4,0,0.7-0.3,0.7-0.7v-1.1c0-0.4,0.3-0.7,0.7-0.7c0.2,0,0.4,0.1,0.5,0.2l2.2,2.1c0.2,0.2,0.5,0.3,0.7,0.3h2.9c1.4,0,1.4-1,0.6-1.7c-0.5-0.5-2.5-2.6-2.5-2.6c-0.3-0.4-0.4-0.9-0.1-1.3c0.6-0.8,1.7-2.2,2.1-2.8C19.6,6.5,20.7,4.8,19.2,4.8z"/> </svg> </span> </a> <a href="https://t.me/share/url?url=https%3A%2F%2Fclihacks.ru%2Favtomatizacziya-i-skripty%2F14241%2F&text=%D0%9A%D0%B0%D0%BA%20%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B8%D1%82%D1%8C%20%D0%BD%D0%B5%D0%BF%D1%80%D0%BE%D1%87%D0%B8%D1%82%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5%20%D0%BF%D0%B8%D1%81%D1%8C%D0%BC%D0%B0%20Gmail%20%D0%B8%D0%B7%20%D0%BA%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D0%BD%D0%BE%D0%B9%20%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8" data-network="telegram" aria-label="Telegram" rel="noopener noreferrer nofollow" > <span class="ct-icon-container" > <svg width="20px" height="20px" viewBox="0 0 20 20" aria-hidden="true"> <path d="M19.9,3.1l-3,14.2c-0.2,1-0.8,1.3-1.7,0.8l-4.6-3.4l-2.2,2.1c-0.2,0.2-0.5,0.5-0.9,0.5l0.3-4.7L16.4,5c0.4-0.3-0.1-0.5-0.6-0.2L5.3,11.4L0.7,10c-1-0.3-1-1,0.2-1.5l17.7-6.8C19.5,1.4,20.2,1.9,19.9,3.1z"/> </svg> </span> </a> <a href="whatsapp://send?text=https%3A%2F%2Fclihacks.ru%2Favtomatizacziya-i-skripty%2F14241%2F" data-network="whatsapp" aria-label="WhatsApp" rel="noopener noreferrer nofollow" > <span class="ct-icon-container" > <svg width="20px" height="20px" viewBox="0 0 20 20" aria-hidden="true"> <path d="M10,0C4.5,0,0,4.5,0,10c0,1.9,0.5,3.6,1.4,5.1L0.1,20l5-1.3C6.5,19.5,8.2,20,10,20c5.5,0,10-4.5,10-10S15.5,0,10,0zM6.6,5.3c0.2,0,0.3,0,0.5,0c0.2,0,0.4,0,0.6,0.4c0.2,0.5,0.7,1.7,0.8,1.8c0.1,0.1,0.1,0.3,0,0.4C8.3,8.2,8.3,8.3,8.1,8.5C8,8.6,7.9,8.8,7.8,8.9C7.7,9,7.5,9.1,7.7,9.4c0.1,0.2,0.6,1.1,1.4,1.7c0.9,0.8,1.7,1.1,2,1.2c0.2,0.1,0.4,0.1,0.5-0.1c0.1-0.2,0.6-0.7,0.8-1c0.2-0.2,0.3-0.2,0.6-0.1c0.2,0.1,1.4,0.7,1.7,0.8s0.4,0.2,0.5,0.3c0.1,0.1,0.1,0.6-0.1,1.2c-0.2,0.6-1.2,1.1-1.7,1.2c-0.5,0-0.9,0.2-3-0.6c-2.5-1-4.1-3.6-4.2-3.7c-0.1-0.2-1-1.3-1-2.6c0-1.2,0.6-1.8,0.9-2.1C6.1,5.4,6.4,5.3,6.6,5.3z"/> </svg> </span> </a> </div> </div> <div class="ct-comments" id="comments"> <div id="respond" class="comment-respond"> <h2 id="reply-title" class="comment-reply-title">Ответить<span class="ct-cancel-reply"><a rel="nofollow" id="cancel-comment-reply-link" href="/avtomatizacziya-i-skripty/14241/#respond" style="display:none;">Отменить ответ</a></span></h2><form action="https://clihacks.ru/wp-comments-post.php" method="post" id="commentform" class="comment-form has-website-field has-labels-inside" novalidate><p class="comment-notes"><span id="email-notes">Ваш адрес email не будет опубликован.</span> <span class="required-field-message">Обязательные поля помечены <span class="required">*</span></span></p><p class="comment-form-field-input-author"> <label for="author">Имя </label> <input id="author" name="author" type="text" value="" size="30"> </p> <p class="comment-form-field-input-email"> <label for="email">Email </label> <input id="email" name="email" type="text" value="" size="30"> </p> <p class="comment-form-field-input-url"> <label for="url">Сайт</label> <input id="url" name="url" type="text" value="" size="30"> </p> <p class="comment-form-field-textarea"> <label for="comment">Оставьте свой комментарий<b class="required"> *</b></label> <textarea id="comment" name="comment" cols="45" rows="8" required="required"></textarea> </p> <div class="h-captcha" data-sitekey="003e0b2a-ad02-4e9f-bd1d-3dddf409dd2d" data-theme="light" data-size="normal" data-auto="false"> </div> <input type="hidden" id="hcaptcha_comment_nonce" name="hcaptcha_comment_nonce" value="4bea8aae8a" /><input type="hidden" name="_wp_http_referer" value="/avtomatizacziya-i-skripty/14241/" /><p class="form-submit"><button type="submit" name="submit" id="submit" class="submit" value="Отправить комментарий">Отправить комментарий</button> <input type='hidden' name='comment_post_ID' value='14241' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p></form> </div><!-- #respond --> </div> </article> <aside data-type="type-1" id="sidebar" > <div class="ct-sidebar" data-sticky="sidebar" > <div class="ct-widget widget_block" id="block-3"> <div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"> <figure class="wp-block-image aligncenter size-full"><img decoding="async" loading="lazy" width="250" height="250" src="https://clihacks.ru/wp-content/uploads/2023/10/clihacks.ru_.png" alt="" class="wp-image-1876" srcset="https://clihacks.ru/wp-content/uploads/2023/10/clihacks.ru_.png 250w, https://clihacks.ru/wp-content/uploads/2023/10/clihacks.ru_-150x150.png 150w" sizes="(max-width: 250px) 100vw, 250px" /></figure> </div> </div><div class="ct-widget widget_block" id="block-6"> <div class="wp-block-group is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-categories-dropdown wp-block-categories has-small-font-size"><label class="screen-reader-text" for="wp-block-categories-1">Рубрики</label><select name='cat' id='wp-block-categories-1' class='postform'> <option value='-1'>Выберите рубрику</option> <option class="level-0" value="19">SSH и удаленное управление  (749)</option> <option class="level-0" value="26">Web и интернет утилиты  (1 207)</option> <option class="level-0" value="16">Автоматизация и скрипты  (1 310)</option> <option class="level-0" value="21">Безопасность и шифрование  (239)</option> <option class="level-0" value="29">Графика и обработка изображений  (186)</option> <option class="level-0" value="30">Звук и музыка  (143)</option> <option class="level-0" value="15">Перенаправление и сетевые команды  (3 705)</option> <option class="level-0" value="24">Работа с Git и системами контроля версий  (345)</option> <option class="level-0" value="23">Работа с временем и датами  (687)</option> <option class="level-0" value="18">Работа с медиа  (1 265)</option> <option class="level-0" value="28">Работа с памятью и хранением данных  (1 102)</option> <option class="level-0" value="25">Работа с редакторами и их настройка  (714)</option> <option class="level-0" value="22">Работа с текстом и данными  (3 140)</option> <option class="level-0" value="14">Работа с файлами и папками  (6 297)</option> <option class="level-0" value="12">Серверы и сетевые службы  (3 143)</option> <option class="level-0" value="17">Системное администрирование и мониторинг  (2 608)</option> <option class="level-0" value="13">Справочная информация и документация  (573)</option> <option class="level-0" value="27">Управление пакетами и установка ПО  (2 084)</option> <option class="level-0" value="11">Управление ресурсами и задачами  (1 488)</option> <option class="level-0" value="20">Утилиты и специальные команды  (1 563)</option> </select> <script type='text/javascript'> /* <![CDATA[ */ ( function() { var dropdown = document.getElementById( 'wp-block-categories-1' ); function onCatChange() { if ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) { location.href = "https://clihacks.ru/?cat=" + dropdown.options[ dropdown.selectedIndex ].value; } } dropdown.onchange = onCatChange; })(); /* ]]> */ </script> </div></div> </div> </div> </aside> </div> <div class="ct-related-posts-container"> <div class="ct-container"> <div class="ct-related-posts"> <div class="ct-related-posts-items" data-layout="grid"> <article > <h4 class="related-entry-title" > <a href="https://clihacks.ru/rabota-s-fajlami-i-papkami/14330/" rel="bookmark">Как получить информацию о текущих подключенных файловых системах в удобном формате</a> </h4> </article> <article > <h4 class="related-entry-title" > <a href="https://clihacks.ru/perenapravlenie-i-setevye-komandy/14329/" rel="bookmark">Как получить внешний IP-адрес с помощью команды curl</a> </h4> </article> <article > <h4 class="related-entry-title" > <a href="https://clihacks.ru/perenapravlenie-i-setevye-komandy/14326/" rel="bookmark">как вывести звук с микрофона на динамики удаленного компьютера</a> </h4> </article> </div> </div> </div> </div> </main> <footer id="footer" class="ct-footer" data-id="type-1" ><div data-row="bottom" ><div class="ct-container" data-columns-divider="md:sm" ><div data-column="copyright" > <div class="ct-footer-copyright" data-id="copyright" > <p>clihacks.ru © 2024 - Лайфхаки командной строки</p></div> </div></div></div></footer></div> <script> ( () => { 'use strict'; let loaded = false, scrolled = false, timerId; function load() { if ( loaded ) { return; } loaded = true; clearTimeout( timerId ); window.removeEventListener( 'touchstart', load ); document.removeEventListener( 'mouseenter', load ); document.removeEventListener( 'click', load ); window.removeEventListener( 'load', delayedLoad ); const t = document.getElementsByTagName( 'script' )[0]; const s = document.createElement('script'); s.type = 'text/javascript'; s.id = 'hcaptcha-api'; s['src'] = 'https://js.hcaptcha.com/1/api.js?onload=hCaptchaOnLoad&render=explicit'; s.async = true; t.parentNode.insertBefore( s, t ); } function scrollHandler() { if ( ! scrolled ) { // Ignore first scroll event, which can be on page load. scrolled = true; return; } window.removeEventListener( 'scroll', scrollHandler ); load(); } function delayedLoad() { window.addEventListener( 'scroll', scrollHandler ); const delay = -100; if ( delay >= 0 ) { setTimeout( load, delay ); } } window.addEventListener( 'touchstart', load ); document.addEventListener( 'mouseenter', load ); document.addEventListener( 'click', load ); window.addEventListener( 'load', delayedLoad ); } )(); </script> <script id='ct-scripts-js-extra'> var ct_localizations = {"ajax_url":"https:\/\/clihacks.ru\/wp-admin\/admin-ajax.php","nonce":"00a95e3af2","public_url":"https:\/\/clihacks.ru\/wp-content\/themes\/blocksy\/static\/bundle\/","rest_url":"https:\/\/clihacks.ru\/wp-json\/","search_url":"https:\/\/clihacks.ru\/search\/QUERY_STRING\/","show_more_text":"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435","more_text":"\u0411\u043e\u043b\u044c\u0448\u0435","search_live_results":"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430","search_live_no_result":"\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e","search_live_one_result":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d %s. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 Tab, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c.","search_live_many_results":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e %s. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 Tab, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c.","expand_submenu":"\u0420\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u043c\u0435\u043d\u044e","collapse_submenu":"\u0421\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u043c\u0435\u043d\u044e","dynamic_js_chunks":[{"id":"blocksy_dark_mode","selector":"[data-id=\"dark-mode-switcher\"]","url":"https:\/\/clihacks.ru\/wp-content\/plugins\/blocksy-companion\/static\/bundle\/dark-mode.js","trigger":"click"},{"id":"blocksy_sticky_header","selector":"header [data-sticky]","url":"https:\/\/clihacks.ru\/wp-content\/plugins\/blocksy-companion\/static\/bundle\/sticky.js"}],"dynamic_styles":{"lazy_load":"https:\/\/clihacks.ru\/wp-content\/themes\/blocksy\/static\/bundle\/non-critical-styles.min.css","search_lazy":"https:\/\/clihacks.ru\/wp-content\/themes\/blocksy\/static\/bundle\/non-critical-search-styles.min.css"},"dynamic_styles_selectors":[{"selector":"#account-modal","url":"https:\/\/clihacks.ru\/wp-content\/plugins\/blocksy-companion\/static\/bundle\/account-lazy.min.css"}]}; </script> <script id='hcaptcha-js-extra'> var HCaptchaMainObject = {"params":"{\"sitekey\":\"003e0b2a-ad02-4e9f-bd1d-3dddf409dd2d\",\"theme\":\"light\",\"size\":\"normal\",\"hl\":\"\"}"}; </script> <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(95243169, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true }); </script> <noscript><div><img src="https://mc.yandex.ru/watch/95243169" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter --> <script defer src="https://clihacks.ru/wp-content/cache/autoptimize/js/autoptimize_69c4b39e069498b2613e181decb3e9cc.js"></script></body> </html>