Shell Access Command Tutorial for Mac Users

Ahmed Malik

by - | 4 years ago
Comments [ 0 ]

6 Sep

Infinarium Rating

Average User Rating

1 Star2 Stars3 Stars4 Stars5 Stars
1 User Reviews
Loading...

Shell commands are normally needed when someone wants to process text/text files to convert all uppercase letters to lowercase letters or deletion of entire class of characters. Despite of the fact, that you can download the new scripts for editing text files in Mac, some users like to do things on their own. Hence, take a look at the whole process…

Mac OSX Mockup Wallpaper - Google Images

Open the Automator and select “Service” from the opened window. Now you can drag the “Run Shell Script” from the Utilities panel and paste the following script, into your open script window;

result=`osascript -e ‘tell application “System Events”‘ -e ‘activate’ -e ‘set result to (display dialog “Enter shell command to filter selected text through:” with title “Filter text” default answer “sort” buttons {“Cancel”, “Filter”} default button 2)’ -e ‘text returned of result & “%%SEP%%” & button returned of result’ -e ‘end tell’ | sed ‘s/”/\”/g’`

[ ! “$result” ] && cat && exit;

button=`echo “$result” | sed s/.*%%SEP%%//`

command=`echo “$result” | sed s/%%SEP%%.*//`

[ “$button” = ‘Cancel’ ] && cat && exit;

cat | sh -c “$command”

after you are done with it, you can save the changes and go for any name, but make sure that you set the save location to Library/Services. But those users who think the process is “too complicated”, they can just download a zip version of that script and save it at the same location, that I mentioned above.

Afterwards, select your workflow and you will see a new pop up window, which is your Filter Text dialogue box. Here you can enter any shell command that you want to use and then click on “Filter”. As a result, your command will be processed and applied to the selected text and feel free to make changes of your own, as there are no limitations to this script.

This entry was posted on Friday, September 6th, 2013 at 11:23 AM and is filed under Computers, How To. You can follow any responses to this entry through the RSS 2.0 feed.

Ahmed Malik

About Ahmed Malik

After completing his Bachelor level degree in Telecom Engineering, Ahmed proceeded to seek specialization in CISCO Certifications (CCNA Routing & Switching, CCNP Routing & Switching, CCNP Troubleshooting). Based on his professional experience, his blog posts at Infinarium are not restricted to a certain aspect of technology.

Join the Conversation

Log In or Create an Account to post a comment, or quickly Sign In with

Top Categories

Top Reviews

LG Hbs 760 vs. LG HBS 770 Tone Pro ̵...

Updated on : 4 months ago

Should I buy B&O H8 Wireless Beopla...

Updated on : 5 months ago

‘Daily Brain Puzzle’ is a su...

Updated on : 5 months ago

Infinarium TV

NVIDIA SHIELD – The Console Killer?

Top Headlines

Archives

WP-Backgrounds Lite by InoPlugs Web Design and Juwelier Schönmann 1010 Wien