Click here to Skip to main content
15,885,720 members
Everything / Programming Languages / Shell

Shell

shell

Great Reads

by V. Subhash
About odd but critical shell-programming details that get easily forgotten or ignored
by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
by Kewin Rausch
Moving forward in the future networks evolution
by fd9750
Overview of required tools to cross compile/build/remote debug C/C++ projects on a Windows host ( 10 ) for a Raspberry PI 3B

Latest Articles

by V. Subhash
A simple fix for excessively bright video and low-volume audio
by hemanthk119
Steps to enable VPN client on an OpenWRT router using openvpn and mwan3
by Ben McNamara
Container classes much faster than STL.
by k5054
How to update a bash variable inside a loop when reading from command output

All Articles

Sort by Score

Shell 

5 Mar 2023 by V. Subhash
About odd but critical shell-programming details that get easily forgotten or ignored
1 Feb 2017 by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
10 Sep 2018 by Kewin Rausch
Moving forward in the future networks evolution
30 Jan 2020 by fd9750
Overview of required tools to cross compile/build/remote debug C/C++ projects on a Windows host ( 10 ) for a Raspberry PI 3B
30 Jul 2019 by Don Hoang
This post describes implementing ASP.NET Gridview using Bootstrap 4.
25 May 2020 by Jonathan Nethercott
Automated Raspberry Pi Setup for .NET Core development and remote debugging using Visual Studio Code
31 May 2019 by Rick Lunglhofer
Details the Implementation and use of a C Language Interpreter with a browser Interface running on an ESP32
25 Aug 2018 by Kewin Rausch
Introduction to protocols to manage Key Exchange in secure channels communication
27 May 2021 by Oscar-Tark
In this article, we will be looking at a more advanced version of a buffer overflow attack.
4 Apr 2010 by OriginalGriff
TrymountingPro...
21 Jun 2011 by rnbergren
The reverse is true as well. Typing "explorer ." will open Explorer from the command line for the current directory you are in. That comes in useful on occasions.
13 Nov 2019 by Marijan Nikic
One-file shell-integrated easy solution for automatic recognition of movies and TV shows
18 Apr 2011 by Guyverthree
PROCESS_INFO...
21 Feb 2012 by Sergey Alexandrovich Kryukov
This is a well-known thing, which is implemented in the class System.Management.Automation.PowerShell, please see: http://msdn.microsoft.com/en-us/library/system.management.automation.powershell%28v=vs.85%29.aspx[^].You can find a simple code sample...
9 Nov 2018 by YasIkeda
Tutorial about how to add authentication functionalities to your existing ASP.NET Core project using Microsoft.AspNetCore.Identity.UI package
18 Apr 2011 by Niklas L
To get ShellExecute[^] to compile, you have to #include That will rid you of the C3861 error.
19 Nov 2011 by User008
Drag 'n Drop asynchronous files from an external server or device
25 Mar 2018 by Dave Kerr
In this article, I'll show you how you can use the shell as an efficient tool to compliment how you use the clipboard.
26 May 2021 by Patrick P. Frey
In this article we see how a very primitive compiler is written in Lua using Mewa and how to compile and run a simple demo program in the shell.
21 May 2021 by Jarek Szczegielniak
In this article we use Visual Studio Code to edit and debug our increasingly complex code running inside a Docker container.
25 May 2021 by Jarek Szczegielniak
In this article, we publish our NLP API service to Azure using Azure Container Instances.
6 Mar 2023 by V. Subhash
This final part of the article series covers some other important behaviour of bash, particularly that relating to text expansions and substitutions.
5 Nov 2023 by V. Subhash
A simple fix for excessively bright video and low-volume audio
18 May 2021 by Jarek Szczegielniak
In this article we run inference on sample images with TensorFlow using a containerized Object Detection API environment.
30 Jan 2010 by Richard MacCutchan
What shell is this, and where do you get the syntax error? Please try to be specific about your problem.
5 Apr 2011 by #realJSOP
It shouldn't matter what version of .Net you use (as long as you're not using 1.n because that's just so freakin' old it's not worth considering). What you need to do is become familiar with how the OS implements the feature. If you stop and think about it, it's merely a scaled down version of...
2 May 2011 by dan!sh
Are you looking for command line arguments[^]? It seems so to me from your comment to Dave.
31 May 2011 by Manfred Rudolf Bihy
Seems that I have found something that might fix your problem:LONG r = ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);The probelm seems to lie with your parameter being SW_SHOWDEFAULT whereas the MSDN sample I found at...
23 Jun 2011 by Member 8009015
My XP method is to:Go to C:\WINDOWS\system32\Right click on cmd.exeSend to Desktop (shortcut)Right click on the Desktop shortcutClear the start in parameterOn the address line of any Explorer directory, start typing cmd and you will get a list of any icons on the Desktop starting...
18 May 2012 by OriginalGriff
The trouble is, that it could be almost anything.The most likely is that the systems on which it is failing are either Vista or Win 7 and accessing a folder / file to which you do not have the necessary permissions.
26 Mar 2013 by Jochen Arndt
This can be done using a C program calling standard C library functions only. Then this source would be OS independant.To do this with Unix shells passing the range on the command line, read about shell programming (especially passing command line parameters, conditions, and arithmetric...
24 Aug 2013 by Zoltán Zörgő
As Mehdi Gholam stated, it is a programming language and it can be used as shell, but it is quite inconvenient as such. It can be a shell because it has an interactive interface, but it is inconvenient because the main shell commands you normally use in a shell are method calls, it won't let you...
11 Sep 2013 by Zoltán Zörgő
Use: sleep ${fname2}m
12 Jan 2018 by sdancer75
Using the code below to run an external exe file, when this app terminates, the parent window loses its focus. I want to disable the parent window to avoid any paint problems and re-activate when the WaitForSingleObject is terminated. Is there any solution for that ? What am i doing wrong...
19 Dec 2017 by Dave Kerr
In this article, I'll show you how to quickly get help when working with tools in the shell, without disrupting your flow!
11 Jan 2018 by Michael Haephrati
You will get more control over the new process you are creating if you use CreateProcess() instead of ShellExecuteEx() and running Update.exe in the background. SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; PROCESS_INFORMATION...
20 Apr 2021 by k5054
When you use a Here Document, the shell effectively does echo -e "1\n2\n" > /tmp/tempname ./test
27 Apr 2021 by Jarek Szczegielniak
In this article, we’ll create a container to run a CPU inference on the trained model.
21 Jun 2021 by V. Subhash
Cut, copy, convert, mix, rotate, flip, resize, crop, combine, compose, blur, sharpen, smoothen, side-by-side split, PIP inset, fade in/out using FFmpeg Filters
17 Feb 2022 by Peter_in_2780
Run it through something like this: svn info | awk 'BEGIN {FS="/"} /^URL:/ {print $6 "/" $7 "/" $8}' [edit] fixed typo [/edit]
21 Apr 2022 by Matt Pogue
Scripting is a crucial skill for any admin to learn. This post walks through the process to develop a batch file download script in Python, demonstrating how to use the interactive Python shell to troubleshoot while writing code.
15 Aug 2023 by Richard Deeming
Quote: I'm expecting to launch the application on the client. Well, there's you problem. Code running on the server cannot launch an application on the client. It might appear to work when you debug your code locally. But that's only...
16 Jan 2024 by Richard MacCutchan
As already suggested to you you need to use ProcessBuilder (Java SE 18 & JDK 18)[^]. The documentation shows how to build a command and use this and associated classes to start it. And here is a tutorial with sample code:...
6 Nov 2012 by PJ Arends
I needed to disable the Sleep button on my keyboard, here's how.
11 Jan 2010 by Rick Shaub
Disclaimer, this is risky business.See this link[^] for a manual way to edit Shell32.dll . By using the File[^] class and the Process[^] class you may be able to mimic this procedure.
11 Jan 2010 by #realJSOP
I wouldn't do it because it's a system DLL, and Vista/Weven don't like it when you mess with system DLLs.
21 Jan 2010 by JimBob SquarePants
Hi all, I'm playing about with the WindowsAPICodePack and i've got a few queries regarding how Windows deals with file types.As part of the API you have the ability to register filetype associations with your application using RegisterFileAssociations(string progId, ...
10 Mar 2010 by Alaric Dailey
For consistency, the icon in your taskbar is the icon on your form (so it makes sense to the user). If you want to do this, the only way I can think to do is some "slight of hand". Change the "show in taskbar" property to falseCreate a new form and force it to stay minimizedchange...
2 Feb 2011 by C. Groß
Hi everybody!First of all, please excuse me if my English is not perfect, I'm not a native speaker.Let me first describe what I'm up to:I want to create a GUI for a command line tool which I have not written by myself.I got so far to be able to launch the tool with desired...
10 Jun 2011 by Graham Shanks
I don't quite understand what the problem is. IShellFolder is part of theWindows SDK, not part of MFC or of ATL.The File Operations sample[^] is one of a number of Microsoft samples that show you how to use it
24 Jun 2011 by thatraja
Here are a couple of other ways:Microsoft PowertoysSend to ToysManually add the context menuThrough batch fileThrough the RegistryAdd Command Prompt here Shortcut to Windows Explorer[^].
27 Aug 2011 by Simon Bang Terkildsen
It does exactly what you what it to.Shell.MinimizeAll() documentation[^]You're suspicious? hmm, when I find a solution to a problem to be much easier than I expected, I put on the the party hat and start dancing around the office :D
1 Nov 2011 by prashant_tambe
Use CreateProcess, create a pipe and pass it as a hStdInput in the STARTUPINFO structure and then you can write the "stop" "start" commands to the pipe, refer this article for how to redirect the stdin and...
30 Mar 2012 by lukeer
Create a file "Autorun.inf" containing this[autorun] open=file.pptxand put it in the root directory of your CD.Some PCs (those with activated autorun functionality) will try to run file.pptx. If a PC has an application installed that can handle .pptx files it will probably open...
6 Apr 2012 by lewax00
I haven't made a shell extension, but I did come across a bit of information about it a while back while researching Internet Explorer extensions (they use the same system more or less).The easiest way to implement something like this would probably be in C# or C++, because you'll need to...
25 Aug 2012 by André Kraak
From Batch File Rename with Windows PowerShell[^]: Dir *.txt | rename-item -newname { $_.name -replace ".txt",".c" }
20 Oct 2012 by Member 9531583
I wrote following command in windows XP's DOS shell and something strange happened:C:\Foleder1\copy sample.txt :because of my typing mistake, I wrote ":" instead of "D:", but it copied the sample.txt to somewhere I cant find!I searched my whole HDD for sample.txt but the only instance of...
20 Oct 2012 by Alan N
Yes it's quite clever! You've hit upon a syntax for creating an NTFS alternate data stream and I think you will have created an alternate stream named :sample.txt which is a complete copy of the original file but hidden from normal view.A bit of background is available in...
9 Nov 2012 by Richard MacCutchan
You may need to put the path string in double quotes to get it accepted. I don't know VB but in C/C++/C# it would be:string rtfPath = "\"C:\\RTF Files\\000001.rtf\"";
23 Jan 2013 by Sergey Alexandrovich Kryukov
It's easy. You need to do it by yourself.You need to use: System.IO.Directory.GetFiles, http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles.aspx[^].There is one unpleasant problem with this API. To take it into account, please see this discussion: Directory.Get.Files...
24 Aug 2013 by Mehdi Gholam
Python is a programming language : http://en.wikipedia.org/wiki/Python_%28programming_language%29[^]However it can be used within a shell.
29 Aug 2013 by CPallini
This works for me:#!bin/shfor c in `seq 1 5`doecho "$c"doneHowever, as Manfred noted, the right syntax depends on the shell you are using.
20 Sep 2015 by Ajesh Novell
I am creating a shell extension. In my property sheet dialog, I have a added a "SysLinK Control". But as soon I add this control my dialog doesn't come. I tried programmatically create this control usingHWND hwnd = CreateWindowEx(0, WC_LINK,L"Ajesh",WS_VISIBLE | WS_CHILD |...
8 Nov 2016 by Afzaal Ahmad Zeeshan
In this post, I will show you how to create a small script to automate the deployment of your ASP.NET Core applications to Microsoft Azure using local git deployment.
11 Jan 2018 by Graeme_Grant
What is wrong with Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)? Here is the full list: // // Summary: // Specifies enumerated constants used to retrieve directory paths to system special // folders. [ComVisible(true)] public enum SpecialFolder { // // Summary: //...
14 May 2018 by Richard MacCutchan
See Why does FindExecutable behave erratically for files with extensions longer than three characters? (And what can you do about it?) – The Old New Thing[^].
25 Jul 2018 by Dave Kreskowiak
There's nothing you can put into the registry that's going to do the whole "If there's something on the clipboard" thing. You're going to have to provide actual code for that and modify the context menu on-the-fly. The only way to do that is to write a shell extension. This is FAR from a...
20 May 2021 by Rob Rob 2021
((Get-Content -Path C:\Folder1\file.txt -Raw ) -split "\s+" | Sort-Object {Get-Random} ) -join ' ' | Out-File -FilePath C:\Folder1\NewFile.txt
18 Jul 2021 by Daniel Pfeffer
Working backwards from the numbers that you give, we get 1 block = 100Mb / 22355 = 4473 bits. This looks close to a 4 Kb (i.e. 512 byte) block size. Adding various header and framing bits make the correspondence even better. I expect that you...
17 Nov 2022 by h_wiedey
This tip shows how md5 and locate can be used to find duplicate files.
16 Oct 2021 by Peter_in_2780
cert_expiration_epoch=$(date +%s -d "$cert_expiration") You really should start using the basic tools available. date --help man date man bash Also as someone else already told you, it's much better to use $(command) rather than `command`
29 Jan 2022 by OriginalGriff
It's going to depend on your OS - the Linux diff is different from the WIndows version, but since you mention cat, I assume you are using linux for some reason. This may help: Shell script using Diff[^]
13 Feb 2022 by steveb
This is impossible. When machine first powers up, there are no Python interpretes on a BIOS level. There fore this cannot be written in Python. Maybe only after boot code was executed. But why would anyone want to write an OS in a slow...
5 Apr 2022 by Richard MacCutchan
sort(1) - Linux manual page[^]
8 Apr 2022 by Gary R. Wheeler
The context menu in the Windows 11 File Explorer has moved all shell extensions to the "shift-F10" submenu. The available documentation seems to state that Win32 apps must be installed using UWP methods to integrate with the Win11 Explorer. This...
8 Apr 2022 by Randor
Hi, You can install the Windows SDK[^] and the MakeAppx and SignTool utilities are included. The steps you need to take are here: Grant identity to non-packaged desktop apps[^] It's not as difficult as it looks, you can use this old code...
26 Jul 2022 by k5054
You can use normal comparison operators inside a bash [[ ]] expresion. Try if [[ $line > 30 ]]; then ... fi
13 Oct 2022 by k5054
Depending on what tools you have available, you have a few options. Lets assume that you can put your two operands in arg1 and arg2 respectively then Perl: perl -e "print $arg1 - $arg2" bc: echo "scale=3; echo $arg1 - $arg2" | bc awk: echo...
8 Feb 2023 by Richard MacCutchan
I just tried this on my Linux system, and the tests for "One year" and "Two year" fail, because the read command splits them into two fields. I have tried putting them in quotes, but it still splits them at the space character. I guess you have...
8 Mar 2023 by k5054
How to update a bash variable inside a loop when reading from command output
3 May 2010 by Riaan Lehmkuhl
Create a new text file called shortname.vbs:Open in Notepad and paste the following code in it:set fso = CreateObject("Scripting.FileSystemObject") strLongName = Wscript.Arguments(0)strShortName = "Invalid File/Folder - (" & strLongName & ")"Set fsoFile = NothingOn Error Resume...
20 Jan 2010 by moayyaed1024
such as a virtual drive that is read the file in iso image or cd imageor colon CD it is has a virtual drivedearif you have some of code to help me tel mei hope to see you in USAthankx
21 Jan 2010 by Eddy Vluggen
You could use the DOKAN-library[^], it has bindings to .NET and is well documented.
24 Jan 2010 by Clement Tan
I'm supposed to create a menu in shell programming comprises of a main menu something like this..1) Add new book2) Remove existing book info3) Update book info and quantity4) Search for book by title/author5) Process a book sold6) Inventory summary report7) QuitEach...
26 Jan 2010 by Graham Breach
Since you mention a .sh file, I guess you mean Unix or Linux shell scripting. There are several different types of shell language that you could be using though - sh/bash, tcsh/csh, ksh ...For any of them the best place to look for information is the manual page - use "man bash" or "man csh"...
30 Jan 2010 by Clement Tan
function check_title_author #function to input title / author{ while [ "$Title" = "" ] do echo "Title : \c " read Title done while [ "$Author" = "" ] do echo "Author : \c " read Author done}
30 Jan 2010 by Clement Tan
Forget to indicate, its shell programming using functions
9 Mar 2010 by llmu
I want to open a webpage in folder view in my shell extension if click a folder name or file name in tree view,so I written code like this:class CShellView : public IShellView, public...
9 Mar 2010 by #realJSOP
Try ShellExceute (I forgot exactly how it's done in C++, but ShellExecute sounds like it should point you in the right direction).
15 Mar 2010 by alexbtr29
Hi,I am using your cliche shell, but found a strange issue with it. It worked flawlessly for a month or so, but now it throws a java.io.InvalidClassException: org.Reticolo; incompatible types for field matriceProssimitaAlfaVariabileObviously i have double checked that params passed are...
15 Mar 2010 by Richard MacCutchan
alexbtr29 wrote:I am using your cliche shellI guess that you are referring to some article here; please post your question in the forum at the end of the article so the author will get a notification of your question.
6 Apr 2010 by Guy Tal
I need to run the cmd shell minimized from C# code. How can i do that?The problem is when I try to run a command using smd (for example mounting of a drive) it opens console window maximuzed and it hides my application Form. It doesn't look good, so I want to find a way to run the cmd...
6 Apr 2010 by CPallini
Poonamol wrote:$(CCC)Shouldn't be $(CC)?What error (or unexpected behaviour) did you get? :)
12 Apr 2010 by huzris
Im am trying to get most of my Windows Explorer on XP.I like functionality provided by "Send To" menu, i can add scripts in it and automate many operations because script gets list of selected files/folders as command argument and does the operation.I dont want to write my own shell...
12 Apr 2010 by Mustafa Ismail Mustafa
huzris wrote:How to master right click menu in windows explorerBy continuous practice. Just keep on right clicking until you get it right :laugh:Seriously though, you ought to take a look at these:Creating a shell extension with C#[^]http://www.contextmenu.net/[^]
12 Apr 2010 by Dave Kerr
I believe the only way to do this will be to implement a shell extension for the particular file types that you want to provide this functionality for, or the * type if it is for all of them.There are lots of shell extension articles on the codeproject that might help you with this, but this...
12 Apr 2010 by huzris
When i think about what I want I see how lazy I am :)Send To is enough, but one click too far for my lazy ass ;DI think that http://www.contextmenu.net/ is what i need, but it costs 150$http://www.codeproject.com/KB/shell/ShellPilot.aspx is close to http://www.contextmenu.net/ and...