Built-in POSIX shell variables

There are built-in shell variables that the shell itself sets and manages, giving scripts a standard way to read arguments, argument counts, exit status, process IDs, and execution state.

They are guaranteed to exist and behave consistently in POSIX-compliant shells such as sh, dash, and ksh, and also in bash and zsh when run in POSIX mode, which is why they are the foundation of portable, predictable shell scripts across Unix-like systems.

Here are a list of built-in shell variables😎👆

Find a high-res pdf book with all my Linux and cybersecurity related infographics from https://study-notes.org

#linux #cybersecurity #TechTips #infosec

2025/12/21 Edited to

... Read moreWhen writing POSIX-compliant shell scripts, understanding built-in shell variables is crucial for creating portable and predictable scripts. These variables, such as $0, which holds the name of the running script, and $1 through $N, which represent individual arguments passed to the script or function, offer a standardized way to access script parameters. Another important variable is $#, which counts the total number of arguments passed. This is especially helpful for validating the inputs your scripts expect. Variables like $@ and $* are used to represent all the arguments passed to the script; $@ preserves each argument exactly as given, while $* merges all arguments into a single string using the first character defined in the Internal Field Separator ($IFS). When monitoring script execution, the special variable $? is essential as it captures the exit status of the last executed command, allowing scripts to make decisions based on success or failure. Similarly, process management integrates variables like $$, providing the process ID of the current shell instance, and $!, which holds the process ID of the last background job. Other variables include $-, representing the current shell options enabled, such as tracing mode activated with set -x. Also noteworthy is $IFS, which defines the characters the shell uses to split input into fields, defaulting to space, tab, and newline, impacting how arguments and text are parsed. Finally, $PPID reveals the parent process ID, useful in scripts that interact with or monitor parent processes or terminals. By mastering these built-in POSIX shell variables, you ensure your scripts run reliably and consistently across various environments including sh, dash, ksh, and POSIX-mode bash and zsh. This foundation supports robust scripting practices and enhances portability across multiple Unix-like operating systems.

Related posts

My Programming Interest Just Skyrocketed! 🚀
I just discovered something that has made my interest in programming explode to 1000000000000000%! 🤯 🎮 Learning Programming is Like a Game Adventure! From Python, Java, JavaScript, to HTML, there are all kinds of programming languages available, along with systematic topic courses. The learning p
Valder

Valder

2162 likes

overnight oats 46g protein + creatine 🤌🏼
#mealprep #highproteinrecipe #protein #overnightoats #proteinbreakfast
stef🐆

stef🐆

273 likes

Language Study Template (Notion) - Part 2 Tutorial
✨Perfect for Chinese learners (but work for any language too). Start your language study journey today with structure, creativity and motivation all in one place. Download now at 🛒missydizzy.gumroad.com #notiontemplate #studytemplates #chineselearning #notionstudent #learnlanguage
Missy Dizzy

Missy Dizzy

2 likes

$1099 Later… Here’s the Truth About the iPad Pro✨
$1099 might sound crazy for a tablet… but here’s why this iPad Pro became my ride-or-die as a work-from-home mom and student: ✨ It’s basically my laptop, sketchbook, planner, & notebook all in one I pair it with: — Apple Magic Keyboard (hello built-in trackpad & laptop vibes!) — Apple
Byaombe •••

Byaombe •••

8526 likes

The image displays the xTiles daily planner interface, showcasing a customizable dashboard with sections for goal mantras, main goals, weekly habits, skills, and important notes, emphasizing its aesthetic and user-friendly design as a Notion alternative.
This image highlights the xTiles template gallery, offering various pre-filled templates like daily schedules, weekly planners, and personal planning layouts, allowing users to start from scratch or use existing designs.
The image demonstrates the tab feature in xTiles, showing how users can add different tabs for organization and freely add and resize tiles anywhere on their board for flexible customization.
My aesthetic xTiles planner, Notion alternative!
If you’re looking for a more aesthetic and flexible alternative to Notion, check out xTiles! With xTiles, you can organize everything exactly how you want, making it super personalized and visually pleasing. Whether you're creating vision boards, planning your week, or just organizing your
Ivyhoneyhive

Ivyhoneyhive

462 likes

A split image comparing Google Drive/Sheets on the left monitor and Notion on the right, with text asking whether students should use Google or Notion for organization.
A desk setup with a monitor displaying Google Drive, alongside text explaining a preference for Google's flexibility over Notion for student organization.
A monitor displaying Notion, with text overlays detailing its uses for students, including semester planning, study schedules, notes, assignment tracking, and digital filing.
Student; Notion or Google Sheets?
📊 If it’s not organized, it’s not getting done. I built a whole system in Notion to track my classes, apps, MCAT, and even my habits… and honestly? It changed everything. Google Sheets helps me plan my week by energy, not guilt. 💡 Use templates to save time 💡 Add emojis for quick scanning 💡 Al
Tyra-Lee 🩺

Tyra-Lee 🩺

96 likes

My Favorite Pages in My Notion Content Calendar
These are my most-used pages inside my Notion Content Planner 📒 the ones that keep my life and creator workflow actually organized ✨ 📅 Content Calendar to visually plan posts across platforms 📊 Analytics to track and compare how my accounts are performing 🎯 Goals to set monthly creator goals
bycharlottesendi

bycharlottesendi

98 likes

A desk setup featuring a tablet displaying Google Calendar and a MacBook Air showing Notion Calendar, illustrating a comparison between the two digital planning tools.
A MacBook Air screen shows Google Calendar, highlighting its primary function for scheduling events, meetings, and tasks, as described in the accompanying text.
A MacBook Air displays Notion Calendar, emphasizing its integration with Notion for project scheduling and its ability to sync with other calendars like Apple or Google Calendar.
google calendar vs notion calendar 🗓️🎧💖
google calendar vs notion calendar 🗓️🎧💖 i’ve been using google calendar since high school, and switched over to notion in the beginning of the year! i’ve been able to play around with notion calendar a lot and wanted to share some differences between the two platforms so you can choose what’s be
lia 💗

lia 💗

280 likes

A laptop displaying a Notion planner with a purple-themed background, showing the title 'THINGS I DO IN MY NOTION PLANNER'. An open book rests in front of the laptop, suggesting a cozy, productive setup.
A Notion page titled 'Goal Tracker' with the overlay 'Track My Goals'. It shows an entry for 'Get my license' with a future date and 'Not started' status, alongside a humorous 'Bikini Bottom Driver License' image.
A Notion page titled 'Hobby tracker' with the overlay 'Track My hobbies and progress in them'. It lists hobbies like 'Electric Guitar' and 'Crochet a mini bee' with their current progress and tasks.
Things I actually use in my new notion planner
Started using this to help with my ADHD and so far its rlly working! The next version I make will have buttons that congratulate you when you complete stuff because I find that helps with my motivation Link in my bio ! #lifestyle #productive #digitalplanning #adhd #lifeorganization
Muse

Muse

9 likes

An iPad displays digital notes on process control, featuring handwritten-style text for Laplace transforms, transfer functions, and block diagrams. Colorful highlighters are stacked next to the device, illustrating digital planning and note-taking.
Text overlays a blurred image of an iPad and highlighters, listing three free handwritten-style fonts: winkle, papernotes, and buttermilk. The text indicates these fonts are available on dafont.com for digital planning.
Text overlays a blurred image of an iPad and highlighters, listing three free fonts: playpen sans, more sugar, and apricots. The text indicates these fonts are available on Canva for digital planning.
Free Fonts for Your Digital Planner
If you love digital planning and journaling, free fonts make such a big difference ✨ I love finding handwritten and aesthetic fonts on DaFont for a personal feel, and Canva has so many clean, easy-to-use fonts built in. Mixing both is perfect for headers, titles, and everyday planning pages 📓🖋️ #
bycharlottesendi

bycharlottesendi

60 likes

Build better habits with this Notion Habit Tracker
I started using this Notion Habit Tracker to organize my daily routines, and it has made staying consistent so much easier. Instead of feeling overwhelmed by big goals, I can now: 🌿 track my habits every day 📊 see my progress visually 🎯 stay focused on what matters 💡 build routines that actu
IdeationWorks

IdeationWorks

16 likes

A laptop displays a Notion template for tracking Stardew Valley Community Center bundles, featuring item checklists, bundle categories, and Stardew Valley-themed graphics like corn and gift boxes. The screen shows various items and their associated bundles.
A close-up of the Notion template shows the 'SDV: Bundle Items' section with a search function highlighted. Checkboxes next to items like Potato and Tomato indicate that checked items disappear, helping users track bundle progress.
The Notion template displays 'Bundles' and 'Rooms' sections, allowing users to check progress on each bundle. Stars indicate donated items, while black circles signify missing items, helping track donations and bundle access.
notion template to track your stardew bundles 🌷💐✨
*i did not create this, but is available online for free!* i’ve been very vocal that i’m on my first ever play through of stardew valley right now, and i’m currently on winter of year 1 and finally decided to see what was up at the community center 😂 i was quickly overwhelmed and was going to m
ℜ𝔬𝔫𝔫𝔦𝔢 🦇

ℜ𝔬𝔫𝔫𝔦𝔢 🦇

164 likes

Spartan Race Spear Throw 💥#spartan #spartanrace #spartanrace2026 #metaglass
builtbyanthony_

builtbyanthony_

8 likes

✿˖° Taking Notes using my iPad and Notion
°𐐪♡𐑂°‧₊ 💌 I rebuilt my note-taking system from the ground up using just two tools. The magic happens on my iPad first where quick Freeform scribbles and Otter.ai’s live transcripts catch every fleeting thought before it disappears. But the real transformation comes when I port everything into Noti
peachiesuga ♡

peachiesuga ♡

39 likes

Gym second week mom dukes decided join me 🏋🏾‍♂️💪🏾🫵🏽💕 #gym #workout #fitness #f
#fashionfinds
Yung Shotta 💙🌋

Yung Shotta 💙🌋

0 likes

My Favorite Pages in My Notion Meal Planner✨
Here are my most used pages inside my Notion Meal Planner Template 🍽️ Meal Planner to plan out weekly meals, stay consistent, and avoid last-minute stress. 📖 Recipe Book for all my favorite recipes in one searchable place 🛒 Pantry to track what I have, what I need, and avoid overbuying Each
bycharlottesendi

bycharlottesendi

71 likes

An iPad in a pink composition book-style case with a pink stylus, white headphones, and a white tube on a wooden surface. The image has text overlayed: '5 WAYS TO USE YOUR IPAD'.
An iPad displaying a digital journal entry titled 'MISSING THE HOMELAND' with various images, text blocks, and a music player widget, set against a dark background with calendar months at the top.
An iPad displaying a font creation interface. The screen shows an alphabet, a large 'A' being designed with grid lines, and tools at the bottom, under the title 'CREATE YOUR OWN FONT'.
5 (more) ways to use your iPad 👩🏻‍💻✍🏻💕
You guys seemed to like the last post, so here are some more ways to use your iPad! ☺️✍🏻💕 1. Digital journaling: turn your iPad into an art journal, junk journal, diary, scrapbook… it is so versatile!! Not only are you saving paper, but you’re also getting to unwind and be creative ✍🏻💕 2. Cre
enchantia

enchantia

27.8K likes

NOTION TOUR ✨how I stay organized w/ notion!
welcome to my notion! I use notion for literally EVERYTHING. it’s a fantastic tool to stay organized with. while notion can feel a little overwhelming at first, templates are a great way to get started. here’s a lil overview of my page: • directory page - I use this page to quickly acces
adrianna

adrianna

59 likes

This infographic, 'How To Build Your Own AI Agent In 10 Minutes,' outlines a 9-step process. It covers identifying a task, mapping steps, choosing infrastructure, defining inputs/outputs/tools, writing a job description, adding memory, implementing guardrails, creating an interface, and testing with real tasks to build a functional AI agent.
How to build your own AI Agent in 10 minutes
#aiagent #aitraining #aiadvancements
LouiseAnn1960

LouiseAnn1960

42 likes

An iPad displays a PDF on recursive programming, with a colorful keyboard and stylus. The image highlights a study tool for students, featuring the UPDF app icon and suggesting it's an essential study aid.
An iPad shows a PDF document alongside an AI assistant panel summarizing 'recursion in JavaScript'. Text indicates the AI can summarize entire PDFs and answer questions based on the material.
An iPad displays a scanned handwritten note converted to PDF, demonstrating how to turn physical paper into digital files for annotation, comparison, or editing. A physical notebook is also visible.
Study smarter not hard 🌸
Hey besties! Struggling with studying this semester? Let me show you how to work smarter, not harder. If you’ve got an iPad or laptop, you NEED to check out UPDF—this AI-powered PDF editor is a game-changer! Here’s why: ❤️ Annotation: Highlight, underline, and add notes to your PDFs—perfect for
Byaombe •••

Byaombe •••

91 likes

The most competitive mushers are also incredibly skilled breeders - I’ve had the honor of getting to know some of those programs and the dogs they’ve produced #dogtok #husky #musher #sleddogs #dogbreeds #ethicalbreeding #reputablebreeder #dogbreed
Glacier Musher

Glacier Musher

0 likes

There’s a system behind everything you do. You have to do the work to find the result! #successera #affiliatemarketing #makemoneyfromyourphone
Shannon

Shannon

0 likes

My Favorite Pages in My Notion Outfit Planner
Here are my most used pages inside my Notion Outfit Planner Template👚✨ Each page helps me stay organized, plan ahead, and actually wear more of what I own 👗 Outfit Planner Where I map out weekly looks, save inspo, and plan outfits around weather + events 🧳 Packing List My go-to for trips w
bycharlottesendi

bycharlottesendi

19 likes

Claude Skills: 90 second mini crash course.. let’s go!✨ Skills teach Claude to do something the same way every time. They can be added in 4 different ways, live in 3 different places and the most fascinating part is how they load to avoid context bloat. #techtok #edutok #aiengineer #cl
lindavivah

lindavivah

1 like

Day 6 Of 28 Daily Challenges To Make Millions
JayWayyGaming

JayWayyGaming

4 likes

A glass jar of overnight oats topped with sliced bananas and peanut butter, displayed next to the recipe. The text details ingredients like gluten-free rolled oats, almond milk, Greek yogurt, maple syrup, and vanilla protein powder, along with nutritional facts and optional add-ons.
Overnight Oats Recipe (no chia seeds)
Good morning!! Happy Wednesday 🤍 Here is todays breakfast!! This is gluten-free🤗 RECIPE 1/2C Rolled Oats (GF) 1/2C Almond Milk 3TBSP 0% Fat Plain Greek Yogurt 2TBSP SF Maple Syrup 1/2 Scoop Truvani Vanilla Protein Powder Stir in a airtight container, and set in fridge overnight 298 cals |
Gianna

Gianna

94 likes

intentalo
#drone #fyp #motivacion #intentalo #viral
🦸🦸Herman🦸🦸

🦸🦸Herman🦸🦸

0 likes

1st SEMESTER NURSING STUDY GUIDE (pt1.)
First semester nursing student, here! 👋🏻 This is PART 1 of my 4part study guide to help those who are also first time nursing students looking for a guide to pass fundamentals of nursing! Hope this helps & goodluck to all taking finals!! 🩷✨ #nursingschool #fundamentalsofnursing #
sydni g 🌷

sydni g 🌷

370 likes

A title slide comparing "MacBook Neo vs iPad Air" with the question "Which One Is Actually For You?" against a light background, featuring a pink MacBook Neo, a white iPad Air, and a yellow MacBook Neo.
A comparison table titled "Basics" detailing specifications like price, screen size, chip, storage, battery, and keyboard for MacBook Neo and iPad Air m4, with images of both devices above.
A slide discussing the use case for students or work-from-home individuals, recommending the MacBook Neo due to its battery life, built-in keyboard, and macOS multitasking capabilities. A hand types on a pink laptop.
Which Apple to Pick 🍎🍏 MacBook Neo vs iPad Air m4
They’re the same price and both just launched, I did a little comparison so you don’t have to. Spoiler: which one is better for YOU entirely depends on your lifestyle. Student? Creator? Or just want a cute computer that works. Both start at $599 and already available for preorder. Which one ar
Unrealtoreal

Unrealtoreal

236 likes

MacBook Air 2026 vs MacBook Pro 2022 power up test 🤯
#macbook #macbookair #macbookpro #apple #fyp
TechLunar

TechLunar

9 likes

Is nuclear energy really more expensive?
Is nuclear energy really more expensive?
I love science!

I love science!

2 likes

A desk setup with two laptops and a monitor displaying code, with a plant in front. Text overlays announce saving 15+ hours/week by replacing roles with ChatGPT, with prompts included below.
A desk with laptops, a monitor showing code and project benefits, and an open notebook. Text states AI automates lead sourcing and data analysis, replacing a lead sourcer/data analyst.
A desk with laptops and a monitor displaying code and a dashboard. Text highlights AI's role in identifying opportunities, crafting outreach, and closing deals faster, replacing a sales executive.
How I Automated 3 Business Roles w/ ChatGPT
I used ChatGPT to fully automate 3 critical roles inside my business — from lead sourcing to client management. Now, these systems run daily while I focus on growth. All prompts & steps below ⤷ Step 1: Replace Your Lead Sourcer / Data Analyst This AI finds new clients and builds a full le
Deft Point Consulting

Deft Point Consulting

23 likes

This is wild work. #autism #neurodivergentbiochemistry #autismandthecomorbiditiestheory #google
Kimberly Kitzerow

Kimberly Kitzerow

3 likes

The image defines 'Service Authorization' in ABA as formal approval from a funding source for specific services over a defined period. It features icons of a head and a clipboard with a checkmark, labeled 'SERVICE AUTHORIZATION ABA CONCEPT BREAKDOWN'.
This image explains why service authorization matters in ABA practice, ensuring appropriate hours, medical necessity, payer compliance, consistent services, and built-in oversight. It also promotes learning more on 'The ABA Compass' blog.
The image defines 'Direct Supports' in ABA as hands-on, face-to-face interactions by a behavior analyst or technician to teach skills, reduce challenging behaviors, and deliver interventions. It features icons of a head and a hand holding a person, labeled 'DIRECT SUPPORTS ABA CONCEPT BREAKDOWN'.
Study 5 ABA Concepts With Me
1- Service Authorization 2- Direct Supports 3- Indirect Supports 4- Troubleshooting 5- Implementation #appliedbehavioranalysis #rbt #bcaba #bcba #studyaba
Emma

Emma

4 likes

7 core Claude Code features explained: mini crash course ... let's go! ✨
To unlock Claude Code's full potential you need to know what's available to you. Here's the TLDR: 🔹 CLAUDE.md → a markdown file Claude loads as context each session 🔹 Skills → packaged instructions Claude loads when the task matches 🔹 MCP → standard protocol for connecting Claude to external
lindavivah

lindavivah

2 likes

Overview of the variables of neurodivergent biochemistry and the autism and the comorbidities theory #autism #neurodivergentbiochemistry #autismandthecomorbiditiestheory #fyp
Kimberly Kitzerow

Kimberly Kitzerow

0 likes

An image featuring Kim Kardashian in front of a Harvard University building, with text announcing Harvard's free online courses and listing 8 courses for 2025.
A screenshot of a Harvard webpage detailing the 'Artificial Intelligence in Business: Creating Value with Machine Learning' course, including start dates and a classroom photo.
A screenshot of a Harvard webpage for 'Data Science: Machine Learning,' showing course duration, time commitment, and that it is free and online.
If Harvard is trying to help people go to college for free, then I’m all for it, I wonder if this administration will look at these different specific types of careers as professional or not but then again if you go to these classes and graduate and get accredited from Harvard, who gives a fuck if
CORALOUW/🥇 achievements

CORALOUW/🥇 achievements

6 likes

whats in my longchamp le pliage Xtra hobo bag 🖤
Have you ever had a bag that you didn't think would blow you away? 🤔 That's how I felt with the Longchamp le pliage Xtra hobo bag - mainly because it's black 😅 but the shiny leather makes the black all the more sophisticated and high-quality 😍 it's a dream 🖤 What I especially
handbags2diefor

handbags2diefor

148 likes

Productivity hack (save 7 hours per week!)
If you do data transfers and emails on a daily basis, magical ai can help you save time (and energy!) it also comes with a built-in AI writer just in case you need an extra hand in responding to different emails. You can use it for free (limited use) but for me it's enough for a normal day of w
teal.days

teal.days

111 likes

The image introduces "DUOLINGO DUPES TO LEARN HOW TO CODE (for free!)" with icons for Mimo, Encode, and Sololearn apps, set against a light blue background with floral patterns.
The image details the Mimo app, showcasing its icon, career paths like Full-Stack Developer and Python AI Developer, and a description of its courses in Python, SQL, JavaScript, and more.
The image highlights the Encode app, displaying its icon, a "LEARN TO CODE" interface, and lesson topics such as Swift Basics and Reusing Code, along with a description of its interactive lessons.
✨CALLING ALL THE TECH GIRLS 🖥️ ✨
Learning to code was never on my radar—until life nudged me in the right direction. As the granddaughter of a brilliant I.T. professional, I didn’t fully appreciate his advice to dive into tech until after his passing in 2021. Now, I’m honoring his legacy by teaching myself to code, one step at a t
✿ Jaide ✿

✿ Jaide ✿

141 likes

Linux command chaining
POSIX-compliant Linux shells (bash, zsh, sh) support command chaining — a simple way to link multiple commands and control whether the next one runs based on success, failure, or just order of execution 😎👆 Find a high-res pdf book with all my Linux related infographics from https://study-notes.o
Dan Nanni

Dan Nanni

6 likes

MY GOODNOTES
All of the fonts I use are from “dafont” Unit titles: Sunday best Body: pumpkin cheesecake topic/sub topic: farmhand #goodnotes #college #takingnotes #fonts
Hannah Coleman

Hannah Coleman

251 likes

Fat Is Not the Enemy:
A Guide to Cooking Fats, Smoke Points, and the Art of Eating Well Without Digging an Early Grave Let's Talk About Fat Fat has been the most misunderstood ingredient in the kitchen for the better part of a century. It has been blamed for obesity, cardiovascular disease, and the general colla
Raíces

Raíces

0 likes

See more