Shell Scripting

The term 'shell' refers to a general class of text-based command interpreters most often associated with the UNIX and Linux operating systems. Popular shells include Bourne, Debian Almquist (dash), Korn (ksh), Bourne Again (bash) and the C shell family (csh). Some view the DOS 'cmd' prompt as a minimal shell of sorts. It is also possible to install Cygwin on Windows and emulate a full Unix environment with complete shell capabilities. Terminal emulators, such as xterm, GNOME Terminal and OS X Terminal, can be used to access shell.

Share tech news, updates, or what's on your mind.

Sign up to Post

How to add custom Run command to Notepad++ for AutoHotkey and other programming/scripting languages
In a recent question here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video Micro Tutorial shows how to do it by adding a custom Run command to NPP. The method may easily be extended to any programming/scripting language that is callable via the command line with a parameter for the source code file name. A second example of this technique is included in the video for running a batch file (.BAT) in NPP.

1. Click the Run menu, then click the first item — Run...


After running NPP and performing the actions above, you will have this dialog:

Step1

2. Browse to the AutoHotkey executable


Click the ... button and navigate to AutoHotkey.exe, which is in C:\Program Files\AutoHotkey\ in a standard installation (but may, of course, be in a different folder on your system).

Step2

3. Add a parameter for the full path of the file in the current tab


You will now have this dialog box:

Step3a
Go to the end of the AutoHotkey.exe file name in the box and add this (including the quote marks):

"$(FULL_CURRENT_PATH)"

Be sure to make it all upper case.

Step3b

4. Save the new Run command


Click the Save... button, which gives you this dialog:

Step4
Give the new, custom Run command a name (I chose AHK in the video) and assign it to a hotkey (if you wish) by ticking CTRL and/or ALT and/or SHIFT, then one of the keys in the drop-down. When you have an OK button that is not grayed out, click it, then click Cancel to close the dialog.

5. Repeat Steps 1-4 for other programming/scripting languages


The video shows how to do it for batch (BAT) files, namely:

cmd /c "$(FULL_CURRENT_PATH)"

You may, of course, do it for other programming/scripting languages.

Step5
2
 
LVL 16

Expert Comment

by:Kyle Santos
Nice.  I use AutoHotKeys and NotePad++ and they're great programs for what I do at my job.  Good video, Joe!
0
 
LVL 54

Author Comment

by:Joe Winograd, EE MVE 2015&2016
Hi Kyle,
Thanks for the compliment and the endorsement — both very much appreciated! Regards, Joe
0
Enroll in July's Course of the Month
LVL 9
Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Linux/ Unix Bash Shell: Working with Files
Learn several ways to interact with files and get file information from the bash shell.

1. ls lists the contents of a directory

2. Using the -a flag displays hidden files

3. Using the -l flag formats the output in a long list

4. The file command gives us more information about a file type

5. rm removes a file

6. rm with the -r flag recursively removes an entire directory

7. cp makes a copy of a file

8

Shell Scripting

The term 'shell' refers to a general class of text-based command interpreters most often associated with the UNIX and Linux operating systems. Popular shells include Bourne, Debian Almquist (dash), Korn (ksh), Bourne Again (bash) and the C shell family (csh). Some view the DOS 'cmd' prompt as a minimal shell of sorts. It is also possible to install Cygwin on Windows and emulate a full Unix environment with complete shell capabilities. Terminal emulators, such as xterm, GNOME Terminal and OS X Terminal, can be used to access shell.