All Questions
4,869
questions
0
votes
1
answer
33
views
how to change the terminal prompt (bash) in vs code mac
so my terminal prompt in vs code mac is showing the process ID and then $. my current shell is bash. but i want my prompt to say the literal name of the directory that i am in and then a $ sign. if ...
1
vote
2
answers
81
views
Renaming jpg files in sequential order in Mac or Windos [duplicate]
I have 100 files that are named 1.jpg,2.jpg,3.jpg....100.jpg in a folder. I would like to rename them sequentially starting from number 83. Eg: 1.jpg becomes 83.jpg, 2.jpg becomes 84.jpg and so on..
I ...
0
votes
0
answers
31
views
Reading last line from a log file within a loop [duplicate]
I'm trying hard to write a script function that reads the last line of a log file while that file is being updated, to use it in arguments.
My idea is to stop the loop when a file is created by ...
0
votes
2
answers
36
views
nvm not working by default on macos terminal
Nvm doesnt work after being installed on my macbook terminal. I try to add the code given by the nvm github repo to my ~/.bashrc file like so:
Martins-MacBook-Air:~ martinbarker$ nvm
-bash: nvm: ...
1
vote
1
answer
68
views
Invoking script using launchd on MacOS is not working
Issue
I have a requirement to monitor a particular folder in Users/<user name>/Libraries/Developer/Xcode/DerivedData. I have written a script that should be run all the time in the background to ...
0
votes
0
answers
49
views
How do I start a python program x times at the same time from terminal and print the output?
I am on Mac, and I need to execute this python program 5 times at the same time while giving each of them a parameter like this.
python program.py instance-1
python program.py instance-2
python ...
0
votes
0
answers
81
views
Openssl command works in Linux but not OSX?
This line of code works in Linux, but doesn't in OSX. What am I missing?
pwd=$(echo "$password_file" | openssl enc -aes-256-cbc -md sha512 -a -d -pbkdf2 -iter 100000 -salt -pass "pass:$...
0
votes
1
answer
83
views
bash: conditional statement causes "unexpected end of file" on macOS
When I source the following simple script in a bash shell on macOS (Sonoma 14.4.1), I get
"syntax error: unexpected end of file".
#!/bin/bash
echo "Hello"
echo "$SHELL"
...
0
votes
0
answers
61
views
More than one if statements
Hi I'm looking at writing a script with the parameters for Teams Classic.
Condition
do i have Teams Clssic.app and is it running
if i have Teams Classic.app and its not running
delete it
if i have ...
0
votes
2
answers
36
views
Maintain position in terminal command history on macOS?
I enter many commands into the terminal. I enter command a, then b, then c, etc. I'm on command g now but I want to execute a, then b, then c, again.
I press up (g), up (f), up (e), up (d), up (c), ...
1
vote
0
answers
65
views
How to find all the files and folders with emoji in the name?
I’m trying to upload files to Box. It doesn’t allow files with emoji in the name to be uploaded. I’m on MacOS. So how can I find all the files, and folders, with emoji in the name? So I can begin ...
0
votes
1
answer
56
views
Why i take this result and how can i solve it?
i use macOS in my internship for mobile developing with flutter.
I am suffer from this two problem from last Thursday morning.
Flutter device daemon #5 exited (exit code 127), stderr: env: bash: No ...
0
votes
0
answers
49
views
Enumerating the files on a directory in localized case insensitive alphabetical order
I am trying to enumerate the files on directory, all mp4 videos, and get their dimensions using FFMEG's ffprobe.
This Bash script is working fine
for filename in *.mp4; do
printf "$filename;"...
1
vote
1
answer
67
views
Why does `command -v` exit code behave differently inside vs outside a bash function?
Consider the following bash script:
#!/bin/bash
# List of required commands
required_commands=('git', 'curl', 'sdfsdf', 'jq')
# this will correctly exit if the 'git' command is missing
cc1='git'
...
-1
votes
2
answers
46
views
How can I save the output of softwareupdate --list as variable in bash on macOS?
I tried:
updates=( $(softwareupdate --list) )
It catches:
echo $updates
Software Update Tool
Finding available software
Instead of the full output:
Software Update Tool
Finding available software
...