<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Source Software and Linux &#187; scripting</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/linux-lotus-domino/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino</link>
	<description></description>
	<lastBuildDate>Thu, 02 May 2013 21:07:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Using the Korn Shell with Linux</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/using-the-korn-shell-with-linux/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/using-the-korn-shell-with-linux/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 01:22:23 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[korn shell]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/?p=130</guid>
		<description><![CDATA[My current consulting gig requires that I use the Korn Shell and modify Unix scripts so that they will work with Linux. While the Korn Shell has many comparable characteristics of BASH there are some distinct differences-or at least ones that I&#8217;ve never seen in BASH. The first difference that I noticed is tab completion. [...]]]></description>
				<content:encoded><![CDATA[<p>My current consulting gig requires that I use the Korn Shell and modify Unix scripts so that they will work with Linux.  While the Korn Shell has many comparable characteristics of BASH there are some distinct differences-or at least ones that I&#8217;ve never seen in BASH.</p>
<p>The first difference that I noticed is tab completion.  For example let&#8217;s say that I issue the command<br />
<code><br />
ls /home/jlittle<br />
</code><br />
and hit the tab key to see the files and directories.  The output that you see will be in this format<br />
<code><br />
ls /home/jlittle/<br />
 1) CentOS-5.2-x86_64-bin-DVD/<br />
 2) Desktop/<br />
 3) Documents/<br />
 4) Video call snapshot 8.png<br />
 5) bin/<br />
 6) ffmpeg.cfg<br />
</code><br />
At this point you can either choose a number and hit the tab key or type in the first couple of letter of what you want to see or do.  The complete output when using the number would look like this<br />
<code><br />
ls /home/jlittle/&lt;tab&gt;<br />
 1) CentOS-5.2-x86_64-bin-DVD/<br />
 2) Desktop/<br />
 3) Documents/<br />
 4) Video call snapshot 8.png<br />
 5) bin/<br />
 6) ffmpeg.cfg<br />
 ls /home/jlittle/Desktop/&lt;2tab&gt;<br />
Project-timeSheet.ods Skype.desktop<br />
</code><br />
Typing 2 tab and the tab completion gives us the listing of the /home/jlittle/.  Kind of a cool way of doing tab completion don&#8217;t you think?</p>
<p>You should also not use the &#8220;test&#8221; built-in that is available in bash.  In bash the test built-in is the same as the &#8220;[" built-in.  In other words don't use<br />
<code><br />
if test $# -gt 0; then<br />
</code><br />
instead use:<br />
<code><br />
if [ $# -gt 0 ]; then<br />
</code></p>
<p>The korn shell also prefers the use of double brackets syntax "[[ ]]" instead of single brackets.  This adds additional operators such as &amp;&amp; and ||:<br />
<code><br />
if [[ $# -gt 0 &amp;&amp; $? -eq 0 ]]; then<br />
</code></p>
<p>You can use &amp;&amp; and || to construct shorthand for an "if" statement in the case where the if statement has a single consequent line:<br />
<code><br />
[ $# -eq 0 ] &amp;&amp; exit 0<br />
</code></p>
<p>The Korn Shell is a powerful tool that can make your job easier.  Since it's creation several features have been added while maintaining backwards compatibility with the Bourne shell.  The Korn shell can also be used as a programming language which gives it a distinct advantage of typical Unix and Linux shells.</p>
<p>Give ksh a whirl.  I haven't even scratched the surface of what the Korn shell can do for your scripting.  If you are used to scripting with Bash then learning the Korn shell should only have a mild learning curve while presenting you with additional scripting power and speed.</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/using-the-korn-shell-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script Word and OpenOffice documents to pdf</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-word-and-openoffice-documents-to-pdf/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-word-and-openoffice-documents-to-pdf/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 11:54:34 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[autoit]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[microsoft work]]></category>
		<category><![CDATA[Open Office]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[pscp]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-word-and-openoffice-documents-to-pdf/</guid>
		<description><![CDATA[I ran into a situation a couple of weeks ago where it would be convenient to script Word and OpenOffice documents into pdf format. One of my jobs here is to create the network and email login documentation for newly hired people. I have the document creation automated through an AutoIT script. I previously posted [...]]]></description>
				<content:encoded><![CDATA[<p>I ran into a situation a couple of weeks ago where it would be convenient to script <a href="http://office.microsoft.com/en-us/word/FX100487981033.aspx">Word</a> and <a href="http://www.openoffice.org/">OpenOffice</a> documents into pdf format. One of my jobs here is to create the network and email login documentation for newly hired people. I have the document creation automated through an <a href="http://www.autoitscript.com/">AutoIT</a> script. I previously posted about AutoIT <a href="http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-repetitious-tasks-in-a-gui-with-autoit/">here</a>.</p>
<p>The next step after <a href="http://searchenterprisedesktop.techtarget.com/answer/Converting-a-Word-document-to-PDF-is-easier-than-the-other-way-around">creating the Word document</a> is to copy it to my Linux workstation where my Lotus Notes client resides. Once there I want to convert it to pdf and attach it to an email for sending to the new hire&#8217;s manager.</p>
<p>I copy the newly created Word document using Putty&#8217;s pscp application. This script is called from the AutoIT script that creates the documents. The pscp script is written as follows:<br />
<code><br />
pscp -pw mypassword -r c:\userdocs jslittl@centos5-xvm:/home/jslittl/Documents/Notes-Domino/users2convert<br />
</code><br />
You can place this script at the end of your AutoIT script so that it copies your document to wherever you want. So this is where I am in the process: AutoIT script to create the document =&gt; scp the document to my Linux workstation.</p>
<p>I followed the instructions <a href="http://www.togaware.com/linux/survivor/Convert_MS_Word.html">here</a> to setup OpenOffice for scripting the documents to pdf. My script to do so is setup like this:<br />
<code><br />
[jslittl@centos5-xvm userdocs]$ cat convertDir2PDF.sh<br />
#!/bin/sh<br />
for i in *.doc; do echo $i; doc2pdf "$i"; sleep 5; done #this will convert all documents in the directory<br />
# zip newusers *.pdf # this is for when there are a large number documents going to the same place-easier to attach 1 zip file<br />
mv *.doc `pwd`/finished-doc # I created the next 3 directories to hold the finished documents<br />
mv *.pdf `pwd`/finished-pdf<br />
mv *.zip `pwd`/finished<br />
[jslittl@centos5-xvm userdocs]$<br />
</code></p>
<p>That&#8217;s it! Just attach them to the email and send them on.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-word-and-openoffice-documents-to-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script repetitious tasks in a GUI with AutoIT</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-repetitious-tasks-in-a-gui-with-autoit/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-repetitious-tasks-in-a-gui-with-autoit/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 15:35:24 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[autoit]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-repetitious-tasks-in-a-gui-with-autoit/</guid>
		<description><![CDATA[Do you find yourself wanting to script repetitious tasks in a GUI? Wish there was a way to automate it? There is now. Unlike shell scripting where many tasks can be automated this is generally more difficult in a GUI. You have mouse clicks and keyboard entries to make in a GUI. AutoIT is the [...]]]></description>
				<content:encoded><![CDATA[<p>Do you find yourself wanting to script repetitious tasks in a GUI?  Wish there was a way to automate it?  There is now.</p>
<p>Unlike shell scripting where many tasks can be automated this is generally more difficult in a GUI.  You have mouse clicks and keyboard entries to make in a GUI.  <a href="http://www.autoitscript.com/autoit3/">AutoIT</a> is the answer to your problem.  AutoIT is designed to script repetitious tasks in a GUI, specifically the Windows GUI and Windows applications.</p>
<p>AutoIT is freeware &#8211; not open source &#8211; designed to automate the Windows GUI and perform other general scripting tasks.  I use it at work for setting up users in Active Directory and Lotus Notes.  The Active Directory part I send to the Windows command line.  The Notes part is done inside the Notes client.  I even have it send the New User documentation over to my Linux workstation via SCP.  There I have a Bash script convert the documents to PDF to be sent to HR.  Pretty cool.  It saves me hours of work every Friday.  Which is why I can write this post and tell you about it <img src='http://itknowledgeexchange.techtarget.com/linux-lotus-domino/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The AutoIT download comes with a lite version of the SciTe IDE.  You can download a full blown version customized to work with AutoIT <a href="http://www.autoitscript.com/autoit3/scite/">here</a>.  With the IDE you get syntax highlighting, script tidying, debug, the ability to compile the script to an .exe file and more.  AutoIT even integrates into the right click text menu so that right clicking on the script gives you the ability to run, compile or edit the script.  <img src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/77/files/2008/08/autoit-editor.PNG" alt="autoit-editor" /></p>
<p>If you need to send your scripts out to users, for instance to have them perform some task or installation on their machine, the compile function is a real life saver.  We use it to compile the script that installs and sets up the VPN and then send it to remote users.  Just burn it to a CD along with the necessary files so that it will autorun and Voila!..no more trying to do it over the phone.  Or you could just send all of the files zipped up in an email and have them put it in a folder for running..but that does require relying on the user to do something.</p>
<p>AutoIT also provides AU3Info.  AU3Info is a tool that will help you find window titles, mouse coordinates and much more window information that will help in writing your script.  You need the active window titles and mouse coordinates so that AutoIT knows when a certain window is active.  Once the window is active you tell the script where to place the mouse, left or right click if necessary and what keystrokes to send.<br />
<img src="http://www.autoitscript.com/autoit3/docs/images/au3spy.png" alt="au3spy" /></p>
<p>AutoIT comes with a full complement of everything required to write any sort of script whether you need to manipulate a GUI or something that you need to run from the command line.   These include datatypes, functions, macros and many others.</p>
<p>The documentation is excellent and very easy to understand.  The forums are active and friendly to new users.  So if you&#8217;re tired of doing that repetitious Windows task why not give AutoIT a spin!  It&#8217;s a great tool for any administrator.</p>
<p>Full disclosure:  I am in no way associated with AutoIT other than being a satisfied user.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/script-repetitious-tasks-in-a-gui-with-autoit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
