0
votes
1answer
11 views

How to run a script on login whilst being hidden

I have an applescript (scpt) script that I would like to run on login of a user. I would like the script not be visible in the dock, menu bar, etc. (This would probably mean running it in the ...
1
vote
1answer
67 views

Why does this bash script not work as an automator service?

I know very little about bash scripting or Terminal commands, this is all very new to me so please bear with me. Original script I would like to use a script I found on littlefield.info as an ...
0
votes
1answer
35 views

How to iterate through multiple file extension without caring about case sensitivity?

I've seen various topics on how to iterate through multiple file extensions, but in most cases the list is defined. example: for file in ${arg}/**/*.{txt,h,py} do .... done As can be seen, ...
0
votes
1answer
57 views

How do I get system_profiler output from a lot of machines in a network?

I need to have a script that will execute "system_profiler -detailLevel full" command in a remote mac machine. While this is going on, the user on the remote machine should not know that there is ...
1
vote
1answer
58 views

Automate mobile terminal?

I have a jailbroken iPhone. I use it to reboot my router when my wifi is going slow or messing up. But I'm lazy and I was looking for a way to automate the process. I use shortcuts that mobile ...
2
votes
1answer
81 views

Shell scripting: Why does only the “-” hyphen throw an error?

Goal: Cleaning up Selectively truncate filenames in my nvALT notes folder. I tried using a productivity blogger's suggestion (which eludes me after a thorough search) to prepend ^ > - + to ...
1
vote
1answer
961 views

need to script connection to telnet and send commands to remote device with no user input

Ok I need some help making a script that will connect to a server and send 2 commands Ideally I would have telnet 192.168.2.230 9993 and once it logs in (no user name or password required - the ...
0
votes
1answer
160 views

how to use terminal to remove item from dock

Hi I have a shell script in my login item , which runs whenever i log in to my system . It does work completely but once it exits the terminal , it leaves the terminal shortcut on my dock and I don't ...
0
votes
1answer
179 views

Move files to individual folders, using file name as folder naming convention for folder, using Terminal

I've been looking for answer on the web now for a few hours and can't find what im looking for. What i want to do is move each file in a directory to a new folder using the name of the file, excluding ...
1
vote
1answer
44 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
2
votes
2answers
321 views

Does Mac OS X's bash read scripts for all users (tab-completion scripts) from /opt/local/etc/bash_completion.d path?

I stumbled upon some instructions in the book "Pro Git" It suggests: Download this file : https://github.com/git/git/blob/master/contrib/completion/git-completion.bash If you use the Bash ...
0
votes
1answer
97 views

What is the proper way to use the cut command on ps command output

This question is related to a question I posted on rogue firefox procesess. It relates to firefox processes following image uploads that I have been having for a while. I am trying to get to the ...
1
vote
1answer
209 views

OS X application start/stop hook

How can I have a script automatically ran when I start or stop an app without using 3rd party tools? I'm not developing the application myself, it's a general question that applies to any installed ...
-1
votes
1answer
37 views

Seeking shell-scripting resources for the visual learner

I'm trying to teach myself shell scripting. I understand things best when I see them in the context of a system, especially when I can visualize that system. I'm looking for a visual companion to ...
1
vote
0answers
62 views

Correct Way to Check if Spotlight Has Indexed a Folder's Contents

Okay, so I've written a script that uses mdfind to more quickly match files, however, I need to find the best way to check whether a target directory is indexed or not, so I can fall back to using ...
1
vote
2answers
53 views

Forcing a script to run in english

My Mac is running Mavericks in English, but because my region is set to Portugal and my keyboard is the portuguese one, when I run some scripts they shows messages in portuguese. I generally hate to ...
2
votes
3answers
313 views

Running a bunch of commands in Terminal

I run the following commands for logkext a lot in my terminal and would like a know a way to automate the whole process. Open terminal type "sudo logKextClient" Type in administrator password ...
2
votes
1answer
5k views

Full privileges on .command file, but it says I don't have appropriate privileges

I have a command that I regularly need to run in the Terminal (for application code signing). Normally I launch the Terminal, press the up arrow until I reach the command I want, and then hit enter. ...
5
votes
5answers
1k views

OSX Bash for loop - issues with spaces in folder names?

I'm getting a bit confused on how to handle spaces in path names when returned in a for loop. Rationale: I'm cleaning up the permissions on folders and files that I copy over from Windows. Most of ...
1
vote
2answers
9k views

How Do I Use 'cp' to Overwrite Files?

Using a shell script or Terminal, how do I overwrite files that may or may not be present. I looked at man page for cp, it said use the -f argument to force overwrite. But, it does nothing. $ cp -f ...
2
votes
1answer
932 views

Trouble in Automator's Shell Script after OS X 10.9 Mavericks upgrade

I've got a problem. I use from lot of time an Automator's shell script: cat >> ~/Dropbox/ClipBoard/Appunti\ Mac\ del\ $(date +\%Y-\%m-\%d).txt It ever worked but, after Mavericks upgrade, ...
4
votes
2answers
357 views

Pipe output of grep to a variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
0
votes
2answers
4k views

line 1: syntax error near unexpected token `newline' with HTML + shell script

I've been learning the shell with a great tutorial, linuxcommand.org. After a lot of learning and practice with navigating directories, editing files, etc, I've moved on to writing shell scripts. One ...
0
votes
3answers
2k views

How to persistently define aliases in Terminal

I want to add aliases to my environment so that they are available in all Terminal instances. I got this answer: Yes, you can put it in your .bashrc, .bash_profile or .profile. On some systems ...
1
vote
2answers
533 views

How can I import a .terminal file using the command line?

I'm writing a (Bash) script to automate setting up my Mac environment and would like to do this, except using the command line only. I'd also like to make that theme the default. I have a .terminal ...
1
vote
1answer
38 views

Can two apps be tied so that when one opens or closes, the other does so?

Can triggers be set up so that when "App A" starts, another "App B" gets started automatically? Ideally, the solution would send a quit message to "App B" when "App A" quits, but the important part is ...
1
vote
1answer
294 views

Automator to execute shell script with an input text file, copy it to specific directory

I'm simplifying making a .deb file with Automator. I currently have a shell script that does some simple actions - Ask the user for text input Do some directory parsing Execute a command with the ...
1
vote
1answer
122 views

Export or list system settings that deviate from defaults

I am looking to generate something similar to this osx settings script. I'm not having any luck finding ways to perform a diff between system defaults and my customized settings. Anyone know of a ...
0
votes
1answer
1k views

Terminal bash commands stopped working

I was trying to install some stuff for scala development on my MAC, and probably I managed broke the shell/terminal while I was mindlessly running some scripts that I don't know. Now when I start the ...
2
votes
0answers
168 views

Can I use the Terminal to find all OpenMeta tags on my system?

I know that there are apps that can do this, so I figure it must be possible: I'd like to compile a list of every OpenMeta tag that I've used on my Mac (OS X 10.8.3). But here's the rub: I'd ideally ...
2
votes
1answer
84 views

How to implement this script on a Mac

I just read Matt Might's blog post on eliminating filler and "weasels" from my writing, and I am wondering how I would implement this on Latex to run and check my document? I know I should use ...
2
votes
2answers
369 views

Using cURL to download images in XML feed?

I have an XML file that has links to various .jpg I want to create an applescript that downloads a local copy of these. The idea is to also label them sequentially with a number say 001 to 030. ...
2
votes
2answers
285 views

“sed” or “awk” launched on opening terminal window

At some point, I've noticed strange behavior of Terminal app - now on opening new window i get this as normal: Last login: Tue Nov 27 11:54:21 on ttys001 but can't see the "~" sign afterwards and ...
0
votes
1answer
406 views

Can't find/run `configure` script on mac os 10.8

I'm trying to install a program called CSIM (neural micro circuit simulator) and one of the steps is as follows: Step 2. Run: configure; make; for Linux/Unix(/Mac OS) But I can't run, not ...
0
votes
1answer
310 views

Programmatically read both per-tab Terminal.app titles

When bringing up the Inspector (⌘I) in Terminal.app to edit the title (⇧⌘I), there are actually two titles that can be entered. The first is known as the Tab Title and affects the terminal window ...
1
vote
1answer
143 views

logger vs syslog -s

What exactly is the difference between using logger and syslog -s? According to its manpage, logger provides interface to the system log module, but I can't really see the point given that syslog(1) ...
1
vote
1answer
546 views

Set terminal window title in a script

I would like to change the entire title of the terminal window for a particular bash script. I googled out but I couldn't find much more than this suggestion: printf "\e]0;My Custom Title\a" After ...
2
votes
2answers
2k views

How can I use Automator to generate a kerberos ticket using KINIT?

I need to be able to generate a kerberos ticket for my MacBook Pro each time the machine restarts. I can manually run KINIT with my credentials to generate a ticket. What is the best way to automate ...
7
votes
4answers
17k views

How do I execute a bash script that requires root privileges?

I have this script lines from my ISP: sudo bash echo "plugin L2TP.ppp">>/etc/ppp/options echo "l2tpnoipsec">>/etc/ppp/options It works if I paste line by line into Terminal. I want to ...
3
votes
3answers
3k views

How can I use Terminal to monitor a network interfaces total traffic in Mb

I would like to use the terminal to monitor the network traffic on a given interface, with a view to providing alerts when certain cumulative totals have been exceeded. The script needs to gain ...
2
votes
1answer
82 views

'script' command in terminal, looking for a flush open

When I use 'script' on a unix terminal the -f option flushes the data straight to the file - from the man page "-f Flush output after each write. This is nice for telecooperation: One person does ...
1
vote
2answers
916 views

What is your preferred way to start a (shell) script from the GUI?

I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight. This is not about opening a terminal and "manually" ...
11
votes
2answers
4k views

What is the difference between .command, .tool, and .sh file extensions?

I saw a couple of questions about executing command line scripts? I saw that the .command and .tool extensions were mentioned. I have always used .sh. What is the difference between these different ...
5
votes
1answer
16k views

How do I remove a user via single user mode in 10.7?

I occasionally will setup a user's machine that has been in for repair beyond the simple re-install of the OS. For example: install a new hd, install the OS, create a user, install updates and then ...
1
vote
2answers
645 views

find video codec from terminal

I'm writing some shell scripts that automatically convert some video files. Except I don't want to run the conversion on files that are already h264 encoded. Is there a way I can tell via a terminal ...
2
votes
4answers
3k views

os x terminal -remove files older than x days

trying to create a scripts that deletes files older than X days. It seemed straight forward enough but all files seem to be getting removed? find /Volumes/Groups/Projects/530_BFAMI/test/ -ctime +30 ...
5
votes
3answers
2k views

Opening a terminal window to a specific directory from a bash script

How can I write a bash script in Mac OS X that opens a Terminal window in a specific directory? I'd assume something like: open /Applications/Utilities/Terminal.app But that does nothing (maybe ...
2
votes
1answer
942 views

Why won't wget work with cron?

I've been using the bashpodder script (http://lincgeek.org/bashpodder/) recently, and while the script works beautifully when I use it in the command line, the crontab I created for it doesn't work at ...
17
votes
4answers
2k views

Concisely starting Mac OS apps from the command line

I do a fair amount of work in the command line, and I find myself defining a lot of aliases of the form: alias skim='/Applications/Skim.app/Contents/MacOS/Skim' Is there a way to add magic such ...
5
votes
4answers
3k views

Alternatives to command line unzip?

I've found that the command line unzip tool doesn't gracefully handle some of the files I'm unzipping: it makes a bunch of junk directories, and creates files whose resource forks aren't found. ...