yes, it's me, liza 🇵🇷 🦛 🦦 on Nostr: #BASH NERDLETTES! am trying to understand why y'all say «mkdir -p -- "$1" && cd -- ...
#BASH NERDLETTES!
am trying to understand why y'all say «mkdir -p -- "$1" && cd -- "$1"» works.
i have something like this for creating site folders in Backdrop & Drupal multisite installations.
the scripts DO create the folders and update & copy all the files that go into them; but it bothers me that the terminal prompt never switches me into the folder.
my expectation is that "cd" moves my prompt into the new folder, not the bash process.
so is that what's happening when in a function?
Published at
2024-06-12 21:53:06Event JSON
{
"id": "60f914ebd5697a06ebbeef2aadb0f66a33751b8bea550c2aa8b6304086836cb5",
"pubkey": "39bd4b787182c3f19644fed5924cf24df8d64d79231f8d73da216f88923ec078",
"created_at": 1718229186,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@blogdiva/112605867975323549",
"web"
],
[
"t",
"bash"
],
[
"proxy",
"https://mastodon.social/users/blogdiva/statuses/112605867975323549",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/blogdiva/statuses/112605867975323549",
"pink.momostr"
]
],
"content": "#BASH NERDLETTES!\nam trying to understand why y'all say «mkdir -p -- \"$1\" \u0026\u0026 cd -- \"$1\"» works.\n \ni have something like this for creating site folders in Backdrop \u0026 Drupal multisite installations.\n\nthe scripts DO create the folders and update \u0026 copy all the files that go into them; but it bothers me that the terminal prompt never switches me into the folder. \n\nmy expectation is that \"cd\" moves my prompt into the new folder, not the bash process. \n\nso is that what's happening when in a function?",
"sig": "7dc9cddac5d30e38191bf56e91298e5673d5dc28d18f4a51ab64374d8ae65f82e24c62f71bf160e2eb3cd974accdcd5f21b09c67fdf94243ebfb5c3d52a47aff"
}