A type of user interface for a computer. This can be both command line or graphical user interfaces. More commonly, shell often relates to the command line interface.

learn more… | top users | synonyms

1
vote
1answer
45 views

Make `hostname -f` return fully qualified hostname

How can i make hostname (i.e. the unix commandline tool hostname, invoked in terminal) return a hostname including the domain information? At the moment, hostname, hostname -f and hostname -s return ...
0
votes
2answers
47 views

applescript will not stop running

I have an applescript that utilizes a named pipe and pipes data over to it. I have my script passing said data in a while loop, which is working, but I find that I am unable to stop the script ...
3
votes
1answer
56 views

How to make “say” command speak AND output to the file at the same time

When using the say command I can give it an option -o (file name) for it to record to a file. However, that suppresses the audio output. Is there a way to make it do both in one command?
3
votes
1answer
59 views

Why does this cause Mac OSX to print over SSH?

While screwing around and breaking things I came across these stupid commands (if executed in order it causes what I got): cd / && cat vmlinuz cd /boot/ && cat init* It causes ...
7
votes
5answers
188 views

How to create an OSX Application to wrap a call to a shell script?

My goal is to include in a zip file what amounts to a shortcut, instead of telling my customer(s) to open up Terminal and run a shell script. My deployable essentially looks like this: $ unzip ...
0
votes
0answers
52 views

Automator shell script - change file extension

I currently have a task that is working. It takes whatever files are added to particular folder and compresses them via Handbrake to another folder: for f in "$@" do HandBrakeCLI --preset="iPhone ...
0
votes
2answers
41 views

Suspended (tty output) when launching editors like vim, vi, emacs, or nano

I've been using Oh-My-ZSH for a few weeks now and it's been a great experience. Just today, though, terminal started acting strangely. When I try to run an interactive terminal editor like vim, vi, ...
0
votes
2answers
56 views

Shell command to count pages in a PDF (other than pdftk)?

I have been using this to get a page count of PDFs in shell scripts in OS X: pdftk "$i" dump_data | grep NumberOfPages | awk '{print $2}' | tr -dc '[0-9]' (where $i is the PDF filename) However, ...
0
votes
1answer
50 views

Applescript or Shell rename a file?

The following is the code I have, however, it doesn't let me choose the extension I want to save it as. How can I save the file as a ".plist" ? do shell script "echo '{ Filter = { Bundles = ( \"'" ...
1
vote
1answer
31 views

Shell script to rsync or if not mounted - mount and rsync

This is what I've got so far: !/bin/sh Storage Folder Backup Defines mount point LOCALMOUNTPOINT="/Volumes/thisisanetworkshare" Checks for mount if mount | grep "on $LOCALMOUNTPOINT" > ...
2
votes
1answer
59 views

Shell Script Commands Work Fine in Terminal But Not Via AppleScript

I have two commands that I need to run through the Terminal. They are cd /Users/[my name]/Desktop and curl 'www.google.com'>google.txt. When running these directly in Terminal they work just fine. ...
1
vote
1answer
42 views

Applescript Calculate Run Time of a Command

How would you calculate the time it took to run a command? Specifically, I want to know the time it takes to return a value in a Shell command. I wrote this up, would it work? (Psuedocode) ...
0
votes
1answer
25 views

How to minimise the terminal automatically when it is running a shell script?

I have a shell script which runs a Python Program. I created the shell script so that the users of my program may simply double click it to run my program. When the shell script is executed; the ...
0
votes
1answer
20 views

Unfortunate deleting binary command file [duplicate]

I deleted "chmod" by mistake using "sudo rm chmod". What is the way to recover the chmod command? Is it 'a no way to do it' operation? I'm using Mac OS X Yosemite.
0
votes
0answers
40 views

Mac doesn't recognise simple commands like 'ls'

I installed Apache and tried to change the permissions for one of Apache's working directories. After that my machine keeps changing the default path. I can't access the simple commands unless I set ...
0
votes
1answer
40 views

dtrace replacement for fseventer?

I think many of us have been disappointed with the effective demise of fseventer. What is a good dtrace shell based alternative to fseventer that will display all full paths of files being accessed ...
0
votes
0answers
28 views

Windows formatted disks owned by $USER, while Mac formatted disks owned by “root”, right?

I noticed that some disks were owned by $USER and some by root: $ ls -l /Volumes total 88 drwxrwxrwx@ 1 jdoe staff 8192 Jul 14 10:22 USBdrive drwxrwxrwx 0 root wheel 0 Jul 14 15:54 ...
0
votes
0answers
36 views

launchagent logs warning/error into console

I have a launch agent that I created several years ago to set a random signature both in a .signature and in Mail.app. It does nothing complicated and has hummed along through several OS X versions. ...
0
votes
1answer
59 views

How can Finder empty Trash more quickly than “rm -rf /Volumes/Foo/.Trashes/501/*”?

The "Trash" of a 16-GB usb2 flash drive had 3.4-GB of data. I emptied it as such: $ cd /Volumes/FooDrive/.Trashes/501 $ rm -rf * This took over 5-seconds. That seemed pretty long. So, as a ...
0
votes
2answers
53 views

How to mount and name a volume if it's not already mounted with a startup script

I'm trying to do something I thought would be simple, but after researching it I feel like I'm half way towards shaving a yak, so I'm asking for advice. I want to create a script that lets me and my ...
2
votes
2answers
37 views

Is there a way to preserve terminal tab history across computer restarts?

I'm using Mac 10.9.5. When I run a terminal with multiple tabs (using bash shell), I've noticed that when my computer restarts, the terminal will open up with the same number of tabs that were open ...
1
vote
1answer
114 views

How can I echo shell script in Automator?

I have an Automator service which runs a shell script (ffmpeg command). I'm looking for a way to see the output of the terminal while ffmpeg does it's thing. Adding echo to the ffmpeg command doesn't ...
0
votes
0answers
23 views

Script - Audio Files - Find, Count and Sort by type

I have a very large audio collection I have to sort. It's a mixture of M4A, FLAC, AIFF, WAV and MP3. It's the result of years of work by a now deceased person who sat in their garage ripping their own ...
0
votes
1answer
48 views

Get terminal application name from shell

I am used to my osascript aliases. In particular, I have nx for opening new tab and closing the old one. However, my scripts use application name to send keyboard signals to it. Instead of writing it ...
0
votes
2answers
171 views

Update bash to version 4.0 on OSX

Is it possible to actually update bash to version 4.0 in OSX Yosemite? echo $BASH_VERSION 3.2.57(1)-release This article and this thread refer to the same question, but they install a new shell ...
0
votes
1answer
29 views

Paste tool for OSX

There is paste tool in Linux but have not found for OSX. Its name was probably dpaste or something in Linux. Assume you run xxd -ps r328.raw | head -n2430 and you want to paste it to your friend. ...
0
votes
0answers
21 views

How to open application through notification in terminal shell

I have the following command to run in a terminal shell script: osascript -e 'display notification "This is a Text" with title "This is a Title"' This is a shell code running in applescript to open ...
0
votes
2answers
131 views

Is there a way or a tweak to make Siri execute shell commands

Indeed I have a home automation system, I would like to integrate a voice control system and for that I need to be able to call shell commands like curl. I have seen many Siri tweaks but none of ...
3
votes
3answers
372 views

Downscale a iMac 5K screenshot to 50% using commandline

Open the Screenshot in Preview Select “Adjust Size…” from the Tools menu Change the Width and Height to 50 percent of the original Change the Resolution to 72 pixels/inch I wish to do this on CLI ...
1
vote
0answers
92 views

Changing color of text in terminal for program output

This might be answered already but I could not figure out a good way to phrase it to look for an answer so I hope you'll bear with me. I want to change the color of the text output on Terminal if it ...
2
votes
1answer
29 views

Terminal backslash input repeated in output

I'm using zsh on a MacBook Pro, OS X 10.10. When I type in certain commands, such as this one: cat myfile | awk -F $'\t' '{print $8, $9}' | sort | uniq -c | sort -k1,1n | awk '{if ($1 > 50) sum += ...
0
votes
0answers
91 views

How do I change the dock and ⌘-tab icons for Spyder (basically a Python script) on a Mac?

I have a little bash script that runs Spyder, a Python IDE, courtesy of this question. The purpose of the bash script is to be accessible via Quicksilver and the Finder. The same answer also tells me ...
-2
votes
2answers
45 views

How do I make this terminal script work properly?

I want it to appear like I'm contacting a bunch of ip-adresses and it works fine until the third line in the code and I want to be able to fix it. Also the 4 bottom lines don't work. So this is ...
0
votes
1answer
54 views

bash- command not fount error

I tried to install omnet++ on my Macbook pro (OS 10.10) yesterday. I got an error so I delete path in my bash-profile. Now, every command I try to run in my terminal shows an error of command not ...
0
votes
1answer
35 views

Shell set environment variables for command

I want to run a program in Terminal and set its environment variables. According to my research one can do this using: VARIABLE="value" VARIABLE2="value2" run_program Now I'd like to set a variety ...
1
vote
2answers
113 views

Does iPhone 5 have a terminal?

I'm new to iPhones and Mac, but I pretty ok with Linux. I think I could solve some of my networking issues, if I could just get into a bash shell, but I haven't been able to locate a shell. Is there ...
2
votes
1answer
27 views

Can't get Terminal to Display Colour (Mavericks)

I've recently been working on a script to backup files, etc. for my own use but recently I thought it may look nicer if I was able to cleanup and have everything nice and tidy (with colours and what ...
2
votes
1answer
89 views

Open application from terminal and remain linked to the process (like Linux) so when CTRL+C is sent to terminal the application closes too

I have an application (closed-source tool not developed by me) which requires another process to exist before executing properly. When I quit this application, I also want that custom process to be ...
2
votes
2answers
69 views

Python script executable opened by text editor

I have a simple "Hello world" script that I want to turn into an executable. The problem is that even though I went through the steps of declaring the path of the Python interpreter in the first list ...
0
votes
0answers
182 views

How to paste Chinese/Unicode characters to Terminal?

I'm trying to paste these Chinese letters: 你好世界 to my Terminal, but instead I've got "^L" or some other weird characters. The same happens for other unicode characters (such as £āēīōūśṣṭēīōū) when ...
1
vote
2answers
659 views

Why `echo -n` doesn't work in this script on mac terminal?

I am learning shell from tutorialspoint today:http://www.tutorialspoint.com/unix/unix-shell-loops.htm And I copied this code block to a loop.sh file: #!/bin/sh a=0 while [ "$a" -lt 10 ] # this ...
0
votes
1answer
68 views

osx service for `mpc add`ing files to mpd’s playlist

I’m trying to create a service in automator, which allows me to add files/folders from Finder directly into my mpd playing queue. I tried the following, the command runs, but nothing happens. ...
0
votes
1answer
78 views

Applescript and Shell: how do I insert a variable?

I'm using the following code to set a Philips Hue bulb with specific hue, saturation and brightness using Applescript. It works perfectly. set TurnOnBulbA to the quoted form of "{\"on\": ...
0
votes
2answers
60 views

Using 'kMDItemContentModificationDate' in 'do Shell Script'

I want to find files modified on a specific date. It is not important what time of day they were modified. I tried the following and got an empty list (no error): set theFolder to (choose folder) set ...
1
vote
0answers
23 views

Filling areas of Json script with user prompts

I am wanting and Applescript to fill certain parts of a Json script via user input prompts, but not sure how to place the results in the correct areas? And to then have the result copied to the ...
0
votes
0answers
22 views

alias command stopped working

I have a few aliases set up on my mac. But for some reason they don't seem to work anymore. I'm not sure why either. Even when I type in alias to see my list of aliases nothing happens just this: ...
2
votes
1answer
271 views

Move all contents from a folder to another with shell script

Why does this work? mv /Users/diogosaraiva/Music/Youtube/Novas/* /Users/diogosaraiva/Music/Youtube/Tratadas …but the commands below don't work? mv "/Users/diogosaraiva/Music/Youtube/Novas/*" ...
10
votes
3answers
839 views

Where is a reasonable sed?

On Yosemite. The sed is old: does not understand \t for example. I installed coreutils and can not find any sed associated with same. What are my options here?
0
votes
1answer
297 views

Automator gets stuck at shell script

I am building an automator script to do automatic backups to a network drive via rsync. The shell script works perfectly fine in terminal and completes and everything, but when i run it from ...
0
votes
0answers
167 views

fish shell suggests commands in tmux

I use fish shell, it's has option "suggests commands", so it is works like in the next screenshot. Examle: You type command git status. In the next time when you type just g or git fish give you ...