Popular Bash recipes tagged "terminal"http://code.activestate.com/recipes/langs/bash/tags/terminal/2013-07-17T17:40:18-07:00ActiveState Code RecipesA Simple Clock, Well Maybe Not That Simple... (Bash) 2013-07-17T17:40:18-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578610-a-simple-clock-well-maybe-not-that-simple/ <p style="color: grey"> Bash recipe 578610 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/digital/">digital</a>, <a href="/recipes/tags/digits/">digits</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/large/">large</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/readout/">readout</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>Hi all...</p> <p>Do you remember this little snippet?</p> <p><a href="http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147" rel="nofollow">http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147</a></p> <p>Well it was voted down, but who cares? I surely don't! So to those that voted this FUN piece of Python coding down, you are now about to see what the aim was.</p> <p>However although I have subsequently done what I said I would, that is, to create large digits as an _at_a_glance_ digital readout for a project in Python I have decided not to upload it. However I have decided to let this one go as a bash/shell script instead.</p> <p>It is a nothing but a simple clock, well, maybe not that simple; but as I am into shell stuff at the moment I thought I would share this with you.</p> <p>The terminal does have its colours changed and the cursor disabled for the session but I expect you big guns to be able to return back to normal in a jiffy.</p> <p>I am an amateur coder and if that is easy for me then you pros should have no problems.</p> <p>This code is not like most of my other stuff as is NOT Public Domain...</p> <p>It is only a DEMO to see what an at a glance display would look like in a terminal.</p> <p>Move away to a distance and see which of the two time readings you can still read... ;o)</p> <p>It is for a Macbook Pro 13" OSX 10.7.5 and uses bash imode. It will probably work on most Linux machines too but I haven't tested it...</p> <p>This is purely a DEMO only and any other special effects, (e.g. flashing colon every second), alram, etc, I have already experimented with and is easy enough to do...</p> <p>My intention is to use this as a kids level text mode digital voltmeter I am doing.</p> <p>Enjoy...</p> <p>Bazza...</p> Bash Script For An Oscilloscope... (Bash) 2013-06-19T19:06:50-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578570-bash-script-for-an-oscilloscope/ <p style="color: grey"> Bash recipe 578570 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/audioscope/">audioscope</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/oscilloscope/">oscilloscope</a>, <a href="/recipes/tags/scope/">scope</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/sound_exchange/">sound_exchange</a>, <a href="/recipes/tags/sox/">sox</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>This code is the latest as of 19-06-2013. It is an AudioScope designed around a Macbook Pro 13" of which only has ONE microphone input. It works under Linux variants too. Read the code for much more info.</p> <p>It was my way of learning Bash scripting.</p> <p>It is resident here at this site:-</p> <p><a href="http://www.unix.com/shell-programming-scripting/212939-start-simple-audio-scope-shell-script.html" rel="nofollow">http://www.unix.com/shell-programming-scripting/212939-start-simple-audio-scope-shell-script.html</a></p> <p>It started off as a fun idea and is now becoming a very serious project.</p> <p>As it stands this is fully working but it is uncalibrated and this is where it will stay on this site.</p> <p>As the above site is the host then all future uploads will be there...</p> <p>To do list...</p> <p>DC input. [1] DC polarity. [1] 2 more Internal sync modes. External triggering. Zoom facility - if possible in text mode. Vertical calibration. [2] Frequency measurement. {3] (Others.)</p> <p>[1] I have simple HW built as an idea but yet to prove it... [2] Preliminary HW built but not yet used. Calibration SW and circuit(s) to be built into script as it progresses. [3] I already have a working script but not completely satisfied at it at this point...</p> <p>I am noing to say much else except that it has already been given a 5 star rating on the above UNIX site...</p> <p>As it stands this code is entirely Public Domian and you may do with it as you please...</p> <p>Enjoy something completely different using Bash scripting...</p> <p>Finally the code defaults to a DEMO mode which requires no HW access at all but everything is still functional...</p> <p>__Thoroughly__ read the code for more information...</p> <p>As a circuit is inside the script then it is best viewed in plan text mode.</p> <p>Bazza, G0LCU.</p> A Shell, Binary To Hexadecimal To Decimal Demo... (Bash) 2013-01-11T18:31:03-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578413-a-shell-binary-to-hexadecimal-to-decimal-demo/ <p style="color: grey"> Bash recipe 578413 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/decimal/">decimal</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/hexadecimal/">hexadecimal</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>This little DEMO may be common knowledge to the big guns but not to amateurs like myself, so......</p> <p>This is an Apple Macbbok Shell/Terminal DEMO shell script to show how to:-</p> <p>1) Create a binary file... 2) Save it to your DEFAULT /directory/drwawer/folder/... 3) Display a hexadecimal dump of said binary file to prove that it is binary... 4) Select a single BYTE of that file and save it as an ASCII text decimal _number_, also to your DEFAULT /directory/drawer/folder/... 5) Read this ASCII text decimal number back in again... 6) Add this string representation to a number... 7) Stop...</p> <p>It was intended purely for OSX 10.7.5 and above using the default terminal and shell...</p> <p>It does work on many Linux flavours and shells/terminals also however.</p> <p>Written so the anyone can understand what is going on.</p> <p>The two files generated and saved in this DEMO to your DEFAULT /directory/drawer/folder/ are:-</p> <p>BinaryString.dat BinaryString.txt</p> <p>This WILL lead to something very unusual in the not too distant future...</p> <p>This is Public Domain and you may do with it as you wish...</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <p>Bazza, G0LCU...</p> Bash Prompt Rainbow Color Chart (Bash) 2011-10-02T21:39:21-07:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/577889-bash-prompt-rainbow-color-chart/ <p style="color: grey"> Bash recipe 577889 by <a href="/recipes/users/4179007/">userend</a> (<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/prompt/">prompt</a>, <a href="/recipes/tags/ps1/">ps1</a>, <a href="/recipes/tags/rainbow/">rainbow</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>This is a simple loop that displays a rainbow of different colors.</p>