<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
  <channel>
    <title>Shell/Terminal Scripts</title>
    <description>Repository of Useful Scripts Contributed by Users.</description>
    <pubDate>Thu, 13 Nov 2014 21:14:32 +0000</pubDate>
    <lastBuildDate>Thu, 13 Nov 2014 21:14:32 +0000</lastBuildDate>
    <generator>macosx.com</generator>
    <link>http://macosx.com/forums/shell-terminal-scripts.221/</link>
    <atom:link rel="self" type="application/rss+xml" href="http://macosx.com/forums/shell-terminal-scripts.221/index.rss"/>
    <item>
      <title>Report on Sharing settings</title>
      <pubDate>Thu, 10 Jan 2013 12:53:23 +0000</pubDate>
      <link>http://macosx.com/threads/report-on-sharing-settings.321945/</link>
      <guid>http://macosx.com/threads/report-on-sharing-settings.321945/</guid>
      <author>invalid@example.com (DiddyDave)</author>
      <dc:creator>DiddyDave</dc:creator>
      <content:encoded><![CDATA[Hi there, <br />
I am new to Mac administration and struggling somewhat on how to programatically report in the settings in the Sharing Preference panel (10.7 and 10.8)<br />
Basically - I want to report in which settings are on and off. I have imagined writing a script to be able to report this status back. <br />
<br />
I can see that for some of the settings I can use &#039;systemsetup&#039; (remote login, remote Apple Events) but for others I am at a loss to where to go check to see if the options are enabled.<br />
DVD and...<br />
<br />
<a href="http://macosx.com/threads/report-on-sharing-settings.321945/" class="internalLink">Report on Sharing settings</a>]]></content:encoded>
    </item>
    <item>
      <title>Unlock root account</title>
      <pubDate>Tue, 13 Nov 2012 21:26:51 +0000</pubDate>
      <link>http://macosx.com/threads/unlock-root-account.321832/</link>
      <guid>http://macosx.com/threads/unlock-root-account.321832/</guid>
      <author>invalid@example.com (lizri)</author>
      <dc:creator>lizri</dc:creator>
      <content:encoded><![CDATA[Hello I&#039;m new here and would really need help with a problem I have been having. I am trying to make a shell script that will enable root account and set the password for the root account. All help is really will be really appreciated <img src="styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie1" alt=":)" title="Smile    :)" /> please help.]]></content:encoded>
    </item>
    <item>
      <title>SU Permission Denied still!!</title>
      <pubDate>Fri, 17 Aug 2012 21:01:31 +0000</pubDate>
      <link>http://macosx.com/threads/su-permission-denied-still.321522/</link>
      <guid>http://macosx.com/threads/su-permission-denied-still.321522/</guid>
      <author>invalid@example.com (ibanez)</author>
      <dc:creator>ibanez</dc:creator>
      <content:encoded><![CDATA[Hi, I&#039;m new here. I have been scouring over google for a while now and can&#039;t seem to understand why i keep getting a Permission Denied error in terminal when i use the &#039;su&#039; command.<br />
<br />
here is what is happening.<br />
<br />
<br />
imacs-iMac:~ imac$ su Dover<br />
Password:<br />
bash-3.2$ /Users/imac/Desktop/GP6/keygen_osx <br />
bash: /Users/imac/Desktop/GP6/keygen_osx: Permission denied<br />
<br />
<br />
what am i doing wrong and why won&#039;t this work?]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Screencapture Command and Multiple Monitors</title>
      <pubDate>Mon, 23 Jul 2012 18:51:34 +0000</pubDate>
      <link>http://macosx.com/threads/screencapture-command-and-multiple-monitors.321386/</link>
      <guid>http://macosx.com/threads/screencapture-command-and-multiple-monitors.321386/</guid>
      <author>invalid@example.com (hsthompson)</author>
      <dc:creator>hsthompson</dc:creator>
      <content:encoded><![CDATA[I need to totally automate a screencapture command for each screen attached to a Mac Pro, running either Snow Leopard or Lion. This would happen hourly, saving each file to the Sites directory, for viewing online (e.g. MONITOR1 -&gt; ~/Sites/monitor1.png, MONITOR2 -&gt; ~/Sites/monitor2.png).<br />
<br />
This is literally the task, so I can&#039;t unfortunately include human intervention/interaction in the process.<br />
<br />
I know how to write the script to do most of this, except I don&#039;t know how to specify a monitor,...<br />
<br />
<a href="http://macosx.com/threads/screencapture-command-and-multiple-monitors.321386/" class="internalLink">Screencapture Command and Multiple Monitors</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Can't execute a simple LS command in my terminal?</title>
      <pubDate>Thu, 14 Jun 2012 14:44:06 +0000</pubDate>
      <link>http://macosx.com/threads/cant-execute-a-simple-ls-command-in-my-terminal.321242/</link>
      <guid>http://macosx.com/threads/cant-execute-a-simple-ls-command-in-my-terminal.321242/</guid>
      <author>invalid@example.com (jbosch)</author>
      <dc:creator>jbosch</dc:creator>
      <content:encoded><![CDATA[Hi,<br />
<br />
I have a Mac OS Lion 10.7.3, for some estrange reason, when I go to my terminal, and execute a ls command I get a &quot;command not found error&quot;.<br />
<br />
I reader somewhere else in this forum about restoring a bash file or the Path. But I can&#039;t reach such file (maybe because I&#039;m new to MAC). The fact is that if I can&#039;t execute commands, my mac is unuseless to me.<br />
<br />
Anyone has any idea about how to fix this? Thanks.]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Opening an URL with escapes</title>
      <pubDate>Sat, 24 Mar 2012 23:25:45 +0000</pubDate>
      <link>http://macosx.com/threads/opening-an-url-with-escapes.320934/</link>
      <guid>http://macosx.com/threads/opening-an-url-with-escapes.320934/</guid>
      <author>invalid@example.com (Mikuro)</author>
      <dc:creator>Mikuro</dc:creator>
      <content:encoded><![CDATA[I&#039;m trying to write a script to take a snippet of foreign text and open it in Google Translate. This SHOULD be very simple: just escape the text, insert it into the URL, and load it in the browser. There&#039;s a problem, though. This is an example of a processed URL:<br />
<br />
<a href="http://translate.google.com/#auto|en|%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94%2C%20%EC%84%B8%EA%B3%84%21%0A" target="_blank" class="externalLink" rel="nofollow">http://translate.google.com/#auto|en|안녕하세요, 세계!
</a><br />
<br />
Copy it into a browser, and everything works fine. However, when I try to open it from a script, it...<br />
<br />
<a href="http://macosx.com/threads/opening-an-url-with-escapes.320934/" class="internalLink">Opening an URL with escapes</a>]]></content:encoded>
    </item>
    <item>
      <title>.pl extension on Mac OS X</title>
      <pubDate>Wed, 18 Jan 2012 14:02:26 +0000</pubDate>
      <link>http://macosx.com/threads/pl-extension-on-mac-os-x.320519/</link>
      <guid>http://macosx.com/threads/pl-extension-on-mac-os-x.320519/</guid>
      <author>invalid@example.com (chirp84)</author>
      <dc:creator>chirp84</dc:creator>
      <content:encoded><![CDATA[I can&#039;t run a perl program after saving it as an .rtf using TextEditor then changing file extension to .pl.<br />
<br />
Very frustrating.  I am switching from Windows Strawberry Perl to Mac OS X Perl v5.12.3.<br />
<br />
The terminal feeds back:<br />
<br />
Backslash found where operator expected at hello.pl line 1, near &quot;rtf1\&quot;<br />
Backslash found where operator expected at hello.pl line 1, near &quot;ansi\&quot;<br />
Backslash found where operator expected at hello.pl line 1, near &quot;ansicpg1252\&quot;<br />
Backslash found where operator expected...<br />
<br />
<a href="http://macosx.com/threads/pl-extension-on-mac-os-x.320519/" class="internalLink">.pl extension on Mac OS X</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>LPadmin Script</title>
      <pubDate>Wed, 09 Nov 2011 10:25:25 +0000</pubDate>
      <link>http://macosx.com/threads/lpadmin-script.319954/</link>
      <guid>http://macosx.com/threads/lpadmin-script.319954/</guid>
      <author>invalid@example.com (risingdead15)</author>
      <dc:creator>risingdead15</dc:creator>
      <content:encoded><![CDATA[Hey Guys,<br />
<br />
I&#039;m new to mac scripting and I was trying to add a network printer using the lpadmin command, I&#039;m about 95% successful, however I have hitting a brick wall when it comes to authentication. here is the command<br />
<br />
<br />
 lpadmin -p &#039;PRINTERNAME&#039; -U &#039;username: password&#039; -v &#039;smb://SERVERPATH?waitjob=false&#039; -P /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd -o printer-is-shared=false -E<br />
<br />
<br />
The reason I am not...<br />
<br />
<a href="http://macosx.com/threads/lpadmin-script.319954/" class="internalLink">LPadmin Script</a>]]></content:encoded>
    </item>
    <item>
      <title>command lines to delete user on Single user mode?</title>
      <pubDate>Sun, 28 Aug 2011 18:57:02 +0000</pubDate>
      <link>http://macosx.com/threads/command-lines-to-delete-user-on-single-user-mode.318392/</link>
      <guid>http://macosx.com/threads/command-lines-to-delete-user-on-single-user-mode.318392/</guid>
      <author>invalid@example.com (Matt OS X)</author>
      <dc:creator>Matt OS X</dc:creator>
      <content:encoded><![CDATA[When you do an OS X install, create a (temporary) user account, run all the updates, then delete the user account and get the machine back to &quot;new&quot; condition, i.e. no user accounts and Setup Assistant runs at boot. <br />
<br />
What about 10.6? I need an official command lines step by step for 10.6 without any errors.<br />
<br />
Please help me out here asap since I&#039;m working on a project here.<br />
<br />
Here&#039;s example for 10.5 from macosxhints.com...<br />
<br />
<a href="http://macosx.com/threads/command-lines-to-delete-user-on-single-user-mode.318392/" class="internalLink">command lines to delete user on Single user mode?</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Rsync and Cron: Mismatched Identical Backups</title>
      <pubDate>Mon, 01 Aug 2011 17:59:59 +0000</pubDate>
      <link>http://macosx.com/threads/rsync-and-cron-mismatched-identical-backups.319097/</link>
      <guid>http://macosx.com/threads/rsync-and-cron-mismatched-identical-backups.319097/</guid>
      <author>invalid@example.com (hsthompson)</author>
      <dc:creator>hsthompson</dc:creator>
      <content:encoded><![CDATA[I&#039;m running an rsync backup script via cron on several machines in our office. Each is using the same parameters.<br />
<br />
The first rsync process is between one machine and another on the LAN. The second is between one machine and an offsite machine; both are on consumer grade cable connections, with an upload speed of 1.82Mb/s from the office.<br />
<br />
The LAN backup gives the expected results, while the WAN backup shows dramatically different total transfer sizes and file counts, though both are using...<br />
<br />
<a href="http://macosx.com/threads/rsync-and-cron-mismatched-identical-backups.319097/" class="internalLink">Rsync and Cron: Mismatched Identical Backups</a>]]></content:encoded>
    </item>
    <item>
      <title>switch of error</title>
      <pubDate>Sat, 30 Jul 2011 10:04:44 +0000</pubDate>
      <link>http://macosx.com/threads/switch-of-error.319078/</link>
      <guid>http://macosx.com/threads/switch-of-error.319078/</guid>
      <author>invalid@example.com (booonanza)</author>
      <dc:creator>booonanza</dc:creator>
      <content:encoded><![CDATA[due to limonade on my keyboard I&#039;m receiving te following message every 5 minutes. is there a way to switch that of? I know buying a new MPB will be the better solution.]]></content:encoded>
    </item>
    <item>
      <title>mount_smbfs</title>
      <pubDate>Wed, 06 Jul 2011 16:02:40 +0000</pubDate>
      <link>http://macosx.com/threads/mount_smbfs.318884/</link>
      <guid>http://macosx.com/threads/mount_smbfs.318884/</guid>
      <author>invalid@example.com (Corex)</author>
      <dc:creator>Corex</dc:creator>
      <content:encoded><![CDATA[I&#039;m trying to mount a networkshare through a shellscript when a user logs on the first time on to the computer (connected to AD 2K3).<br />
<br />
mount_smbfs can only be run as root and the users only has standard privileges.<br />
<br />
Though if i execute the shellscript trough Automator without admin rights the mount_smbfs command executes without any problem (with the same standard user) wich is kinda weird. Anyone has a solution for this since Automater takes some resources and alot more time to complete...<br />
<br />
<a href="http://macosx.com/threads/mount_smbfs.318884/" class="internalLink">mount_smbfs</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Problem: Scheduling rsync with include-from/exclude-from file</title>
      <pubDate>Mon, 23 May 2011 18:05:44 +0000</pubDate>
      <link>http://macosx.com/threads/problem-scheduling-rsync-with-include-from-exclude-from-file.318476/</link>
      <guid>http://macosx.com/threads/problem-scheduling-rsync-with-include-from-exclude-from-file.318476/</guid>
      <author>invalid@example.com (hsthompson)</author>
      <dc:creator>hsthompson</dc:creator>
      <content:encoded><![CDATA[I&#039;ve written a bash script which uses rsync (rsync.sh) to back up a user&#039;s home folder. Some directories can be excluded, so I&#039;ve specified an external file (filelist.txt) for the include-from and exclude-from options. The script is run from the source machine. The rsync command uses ssh, with an alternate port, to connect to a remote machine. The -E option is also used, to preserve resource forks under Mac OS X.<br />
<br />
If I run the script manually via the Terminal&#039;s sh command, it works as...<br />
<br />
<a href="http://macosx.com/threads/problem-scheduling-rsync-with-include-from-exclude-from-file.318476/" class="internalLink">Problem: Scheduling rsync with include-from/exclude-from file</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>command lines to clear software update history?</title>
      <pubDate>Wed, 04 May 2011 17:20:41 +0000</pubDate>
      <link>http://macosx.com/threads/command-lines-to-clear-software-update-history.318381/</link>
      <guid>http://macosx.com/threads/command-lines-to-clear-software-update-history.318381/</guid>
      <author>invalid@example.com (Matt OS X)</author>
      <dc:creator>Matt OS X</dc:creator>
      <content:encoded><![CDATA[I am trying to find a way to clear software update history list by using command lines. Is there a way? I checked Software update manual on Terminal, no luck. <br />
<br />
Wikipedia show in details but nothing mentioned things like: &#039;clear history&#039;<br />
Apple Software Update - Wikipedia, the free encyclopedia<br />
<br />
And, of course, I tried to google for answer- still no luck.<br />
<br />
Anyone?]]></content:encoded>
      <slash:comments>2</slash:comments>
    </item>
    <item>
      <title>help with search and copy script</title>
      <pubDate>Tue, 22 Feb 2011 04:20:26 +0000</pubDate>
      <link>http://macosx.com/threads/help-with-search-and-copy-script.317830/</link>
      <guid>http://macosx.com/threads/help-with-search-and-copy-script.317830/</guid>
      <author>invalid@example.com (realmjumper99)</author>
      <dc:creator>realmjumper99</dc:creator>
      <content:encoded><![CDATA[I have a number of files sprawled out over multiple directories on my one external drive (I use it to back up multiple machines I work on here at work)<br />
I want to gather all of those files into one folder (/collection) so that I can go through them all and come up with one consistent naming and filing system.<br />
The workflow of the script should go as follows:<br />
1. Recursively search for all files of type &quot;log&quot;<br />
2. Each time it finds a file it puts the file name and path into a variable (%C)<br />
3....<br />
<br />
<a href="http://macosx.com/threads/help-with-search-and-copy-script.317830/" class="internalLink">help with search and copy script</a>]]></content:encoded>
      <slash:comments>4</slash:comments>
    </item>
    <item>
      <title>Adding Lines to Startup Shell Scripts</title>
      <pubDate>Thu, 27 Jan 2011 16:16:58 +0000</pubDate>
      <link>http://macosx.com/threads/adding-lines-to-startup-shell-scripts.317600/</link>
      <guid>http://macosx.com/threads/adding-lines-to-startup-shell-scripts.317600/</guid>
      <author>invalid@example.com (Raevyn)</author>
      <dc:creator>Raevyn</dc:creator>
      <content:encoded><![CDATA[Hai!<br />
<br />
I am lost.. I am trying to install Fink on my Mac OS 10.5, and it popped up a message saying that it knows what I am doing, so I need to a line equivalent to <br />
<br />
source /sw/bin/init.sh<br />
<br />
to one of my sh startup scripts. <br />
<br />
I do NOT understand what it saying to do. Im not a shell person really and just learning. Can anyone help? I have it set to use BASH if that helps. I am also enclosing a screenshot in case that also helps.]]></content:encoded>
      <slash:comments>9</slash:comments>
    </item>
    <item>
      <title>terminal report for Seagate HD</title>
      <pubDate>Mon, 15 Nov 2010 19:21:42 +0000</pubDate>
      <link>http://macosx.com/threads/terminal-report-for-seagate-hd.316888/</link>
      <guid>http://macosx.com/threads/terminal-report-for-seagate-hd.316888/</guid>
      <author>invalid@example.com (metric)</author>
      <dc:creator>metric</dc:creator>
      <content:encoded><![CDATA[Hallo all :<br />
<br />
My Seagate ES.2 500GB hd just stopped one day -  Seagate says is not effected by firmware bug -  HD still spins -  just does not recognize is hard case or other computer - <br />
<br />
am told to get a terminal report -  countless instruction on a PC - I am all Mac<br />
<br />
can anyone lend some assist here -  I have all the cables and power - not sure of commands or how to get terminal report on this HD <br />
<br />
cheers in advance]]></content:encoded>
      <slash:comments>6</slash:comments>
    </item>
    <item>
      <title>easy way to pack application that run off from CD-ROM?</title>
      <pubDate>Sat, 17 Jul 2010 06:28:36 +0000</pubDate>
      <link>http://macosx.com/threads/easy-way-to-pack-application-that-run-off-from-cd-rom.315449/</link>
      <guid>http://macosx.com/threads/easy-way-to-pack-application-that-run-off-from-cd-rom.315449/</guid>
      <author>invalid@example.com (zhangweiwu)</author>
      <dc:creator>zhangweiwu</dc:creator>
      <content:encoded><![CDATA[Hello. I recently try to make an application to run on all of Linux, Mac<br />
OS and Windows, on the CD-ROM. It does not come with an installer (green<br />
software), and user was supposed to run the application directly from<br />
the CD-ROM.<br />
<br />
First I make sure the application runs fine by launching from<br />
commandline (xterm in Linux, CMD.exe in Windows, Terminal in Mac OS).<br />
This is tested on all 3 operating systems, the software runs just fine<br />
on all 3 OSs.<br />
<br />
Then I make shortcut for Windows, put the...<br />
<br />
<a href="http://macosx.com/threads/easy-way-to-pack-application-that-run-off-from-cd-rom.315449/" class="internalLink">easy way to pack application that run off from CD-ROM?</a>]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>unable to enter password in Terminal</title>
      <pubDate>Tue, 29 Jun 2010 13:20:41 +0000</pubDate>
      <link>http://macosx.com/threads/unable-to-enter-password-in-terminal.315455/</link>
      <guid>http://macosx.com/threads/unable-to-enter-password-in-terminal.315455/</guid>
      <author>invalid@example.com (Mongo9421)</author>
      <dc:creator>Mongo9421</dc:creator>
      <content:encoded><![CDATA[I am trying to enter some text in Terminal which I can do, but when I try to enter my password, I am unable to. I am new to the world of Mac&#039;s. Any help would be appreciated.]]></content:encoded>
      <slash:comments>2</slash:comments>
    </item>
    <item>
      <title>Hide TERMINAL on Startup</title>
      <pubDate>Thu, 06 May 2010 18:13:18 +0000</pubDate>
      <link>http://macosx.com/threads/hide-terminal-on-startup.314244/</link>
      <guid>http://macosx.com/threads/hide-terminal-on-startup.314244/</guid>
      <author>invalid@example.com (quantass)</author>
      <dc:creator>quantass</dc:creator>
      <content:encoded><![CDATA[I m using Synergy to link Windows and OSX.  On OSx i have a simple shell file that launches the synergy app with parameter.  I placed this file within the Login Items list but each time i startup the Terminal window appears.<br />
<br />
Is there any way i can have the Terminal window hidden from view on system startup OR an alternative way to launching synergy in the background to avoid the annoying, unnecessary display?<br />
<br />
Thanks.]]></content:encoded>
      <slash:comments>1</slash:comments>
    </item>
  </channel>
</rss>
