# Shell Scripting

Published articles for Shell Scripting.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Opening Sublime Text from the command line

DevFeed: [Opening Sublime Text from the command line](<https://devfeed.tech/articles/opening-sublime-text-from-the-command-line-39471.md>)

Original publisher: [Read original article](<https://akrabat.com/opening-sublime-text-from-the-command-line/>)

Author: Rob

Published: 2026-06-30T10:00:00Z

Content type: tutorial

Language: en

Sources: [Rob Allen](<https://devfeed.tech/sources/rob-allen.md>)

Topics: [Sublime Text](<https://devfeed.tech/topics/sublime-text.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [JSON](<https://devfeed.tech/topics/json.md>), [sessions](<https://devfeed.tech/topics/sessions.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [computing](<https://devfeed.tech/tags/computing.md>), [extension](<https://devfeed.tech/tags/extension.md>), [json](<https://devfeed.tech/tags/json.md>), [sessions](<https://devfeed.tech/tags/sessions.md>), [shell-scripting](<https://devfeed.tech/tags/shell-scripting.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

A tutorial on using a Bash function to open Sublime Text from the command line with different window behaviors for directories and files. It extends the function to create and manage a hidden .sublime-project JSON file so open files persist across sessions.

### Source excerpt

I nearly always open Sublime Text from the command line using subl and have specific requirements for when it should open a new window or re-use one. If I'm opening a directory, then I would like it to re-use the same window if I have previously opened that directory. However if I open a random file, I never want that file in the last directory window as it's unrelated. To do this I wrote a... continue reading.

## A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling

DevFeed: [A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling](<https://devfeed.tech/articles/a-bash-script-to-read-all-command-line-arguments-into-an-array-simplify-argument-handling-41963.md>)

Original publisher: [Read original article](<https://www.cyberciti.biz/tips/a-bash-script-to-read-all-command-line-arguments-into-an-array.html>)

Author: Vivek Gite

Published: 2024-05-07T10:40:08Z

Content type: tutorial

Language: en

Sources: [nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED)](<https://devfeed.tech/sources/nixcraft-linux-tips-hacks-tutorials-and-ideas-in-blog-format-rss-feed.md>)

Topics: [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [arrays](<https://devfeed.tech/tags/arrays.md>), [bash](<https://devfeed.tech/tags/bash.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [printing](<https://devfeed.tech/tags/printing.md>), [process](<https://devfeed.tech/tags/process.md>), [script](<https://devfeed.tech/tags/script.md>), [shell-script](<https://devfeed.tech/tags/shell-script.md>), [shell-scripting](<https://devfeed.tech/tags/shell-scripting.md>), [sys-admin](<https://devfeed.tech/tags/sys-admin.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

A tutorial on using Bash's mapfile or readarray built-in to read command-line arguments into an indexed array. It explains how arrays can handle a variable number of arguments and preserve spaces for later processing.

### Source excerpt

If you are writing a Bash shell script, you should read command-line arguments into an array for some time. This allows us to process any number of arguments provided when the script is run. This makes the script adaptable to different use cases. Instead of dealing with fixed variables like $1, $2, $3, etc., you can work with any number of arguments more dynamically using bash for loop or bash while loop, depending upon your needs. Arrays make it simple to loop through each argument and perform operations on them, whether basic printing or complex processing. Bash provides a mapfile (readarray command) internal built-in command to read lines from a file into an array variable. Let us see how to use mapfile to read all command line arguments into an array. Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit The post A Bash Script to Read All Command Line Arguments into an Array: Simplify Argument Handling appeared first on nixCraft.