А знаете ли вы, что в Bash есть особая переменная "$_" ? Из описания можно узнать, что в переменную "$_" помещается последний аргумент последней команды.
Что-то знакомое? Конечно, в Python есть примерно тоже самое.
Мы знаем, что дата первого релиза Bash (8 июня 1989) несколько раньше чем первый релиз Python (20 февраля 1991). Если учесть, что по задумке автора Python это агрегация самых успешных практик отовсюду, можно ли сказать что именно эта фишка к нему пришла из Bash? Ни подтверждения ни опровержения я пока не нашел.
Давайте просто считать это совпадением 😉
А как это может быть полезно в Bash?
Приведу простой пример, который оценят те, кто часто работает в терминале.
Допустим, нам надо создать директорию и зайти в неё. Что обычно делаем?
:~$ mkdir foldername
:~$ cd foldername
:~/foldername$
Как это сделать в одну команду?
:~$ mkdir foldername && cd foldername
:~/foldername$
Уже лучше, но хочется короче, без повторов. Вот тут и пригодится наша переменная. Напомню, что в неё сохраняется последний аргумент предыдущей команды.
:~$ mkdir foldername && cd $_
:~/foldername$
_________________
PS.
Символы "&&"" разделяют команды и означают, что требуется выполнить вторую команду только если первая завершилась успешно.
#linux#tricks
🔥 BingX $SING Fixed Savings is LIVE! 🚀
💰 Earn up to 200% APR by staking your $SING!
🏃♂️ Limited quota – subscribe now before it’s gone!
📅 Subscription Period: Now – Nov 24, 2024, 07:00 AM (UTC)
🔗 Start Staking: https://bingx.com/en/wealth/subscription?actId=&assetName=SING&productId=1374930318547673175&productType=1
⏳ Don’t miss out on this incredible earning opportunity!
#BingX#SingSing#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🔥 MetaGram: MGR Staking is LIVE
Stake your $MGR and earn up to 80% APR.
• Flexible lock terms: 7–365 days
• 0% platform fees while staking
• Trading pair: MGR/BNB (details soon)
👉Start now 👉👉👉👉👉👉👉👉
👉https://metagram.digital/staking
#MetaGram#MGR#DeFi#BSC#Staking#CryptoEarnings
🚀 USDC Holders May Face End of 4% Earnings Amid Legislative Push
PANews posted on X (formerly Twitter) that the days of earning a 4% return by holding USDC might be coming to an end. The American Bankers Association (ABA) has reportedly spent $56.7 million lobbying for the passage of the 'Clarity Act.' The primary aim of this legislation is to prevent users from obtaining returns similar to government bonds through stablecoin holdings. The banking sector's main concern is that if stablecoins can offer an annualized return of 4% to 5%, it could potentially impact up to $1.5 trillion in retail deposits.
#USDC#Stablecoin#ClarityAct#AmericanBankersAssociation#CryptoRegulation#CryptoEarnings#BankingSector#Legislation#RetailDeposits
🔥@CryptoDailyPrice – Your shortcut to daily crypto power! 💰
Get live price updates, learn pro trading tricks, and discover zero-investment earning hacks that actually work. 🚀
Stay tuned — every post drops something crucial, profitable, and mind-opening for crypto lovers like you! ⚡
#CryptoDailyPrice#CryptoUpdates#CryptoEarnings#CryptoTrading#CryptoTips#LearnToTrade#ZeroInvestment#CryptoForBeginners#DailyCryptoNews#PassiveIncome#CryptoSignals#CryptoMarket#CryptoProfit#StayTuned#EarnWithCrypto
💸 New Payment Received from Tonpick Faucet! 💸
💰 Hourly TON Faucet — Earn free TON easily!
✅ Claim faucet every 60 minutes
✅ Confirm your email to get 10 spins & 2X rewards for 24h
✅ Complete surveys for extra rewards
✅ Invite friends & earn 50% from their claims
💵 Min withdraw: only 0.1 TON
🌐 Join here:
https://tonpick.game/?ref=FREE_CRYPTO_TG
#TON#FreeTON#CryptoFaucet#CryptoEarnings#MakeMoneyOnline#Airdrop#FreeCrypto#PassiveIncome#WorkFromHome#CryptoRewards
---
💸 دفعة جديدة من Faucet Tonpick! 💸
💰 صنبور TON كل ساعة — اربح TON مجانًا بسهولة!
✅ المطالبة بالصنبور كل 60 دقيقة
✅ تأكيد بريدك الإلكتروني لتحصل على 10 دورات و ضعف الأرباح لمدة 24 ساعة
✅ إكمال الاستبيانات لربح إضافي
✅ دعوة الأصدقاء وربح 50% من أرباحهم
💵 الحد الأدنى للسحب: فقط 0.1 TON
سجّل الآن:
https://tonpick.game/?ref=FREE_CRYPTO_TG
#ربح_المال#كريبتو#TON#ربح_TON#ايردروب#PassiveIncome#ربح_مجاني#بوتات_تيليجرام#ربح_من_الانترنت