applescript – Can I handle the "open" Apple event in a bash shell script using the osascript command?

I am using a bash script ( in an application bundle (, which starts "java -jar myJarFile.jar" with additional JVM arguments (which work well up to now). My goal is to pass a file name as an argument to the application as well, each time the user opens a file via "open with …".

I have tried to implement OpenFilesHandler in the java application and copy an AppleScript-scpt file into the bundle which calls without success.

The last thing I tried just to test all the possibilities was to call osascript in the bash


#test: set command line args
MY_TITLE="Launching myJavaJarApp"
ARGS_MSG="command line args: "

osascript <<-EndOfScript
    set arguments to ""
      on open theFiles
            repeat with anItem in theFiles
               set arguments to arguments & space & (quoted form of POSIX path of anItem)
            end repeat
      end open
    display dialog "$ARGS_MSG" & arguments with title "$MY_TITLE"     

Didn't work, the dialog just says $ ARGS_MSG and no arguments, when I open a file with

It seems to me that defining the bash script as CFBundleExecutable "consumes" all AppleEvents.

Or is there a way?

apache 2.2 – Hacked WordPress – redirect to the shell

my wordpress site redirects to the following shell.

I took the website offline and restored from the backup – although I would love to know more about this shell.

I installed a "test" server with the pirated shell.

if I go to "" (running WordPress) – I'm redirected to this shell.

If I go to "" – I am redirected to this shell but in the wp-admin directory.

Where does the redirect take place and where is this shell installed (like .PHP files).

shell screenshot

it is quite the "cunning" shell hack

MacOS shell script to automate screen recording with OBS (or other screen recorder)

Is there a way to use the command line to start and record my screen in OBS. ? I can build OBS from source and start it with ./obs but how can i execute other commands? There appear to be launch parameters documented here:

But how can I include these parameters in my command line?

How to set the default shell on WSL bash for SSHing from one Windows 10 machine to another Windows 10 machine (VM)?

I am SSHing in a virtual machine on the Windows command line and the WSL bash. However, every time I log into the Windows 10 virtual machine (from my own local Windows 10 machine), it opens the default Windows command prompt as a shell. I would like the WSL bash to open when I use SSH on the Windows command prompt and WSL bash (on my local machine). My local and virtual machines have WSL installed.

I have tried: New-ItemProperty -Path "HKLM:SOFTWAREOpenSSH" -Name DefaultShell -Value "C:WindowsSystem32bash.exe" -PropertyType String -Force on the Windows Powershell running as administrator but it doesn't work. All I get is this, but no change:

DefaultShell : C:WindowsSystem32bash.exe
PSPath       : Microsoft.PowerShell.CoreRegistry::HKEY_LOCAL_MACHINESOFTWAREOpenSSH
PSParentPath : Microsoft.PowerShell.CoreRegistry::HKEY_LOCAL_MACHINESOFTWARE
PSChildName  : OpenSSH
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.CoreRegistry

UPDATE: I can change the shell, after having SSH in the Windows 10 virtual machine, by running bash.exe of C:WindowsSystem32. However, it always starts as the Windows command line by default when I launch SSH for the first time.

shell – my bash can recognize lowercase and uppercase are the same


then i get a message
'' and '' are the same file

why did my ubuntu not recognize lowercase and uppercase letters?

cd it works fine but, for example, I want to move the src directory,

CD src

then i get a message
bash: CD: command not found

without this kind of case, my bash works well ..

env ubuntu 18.04
tell me if get more information to fix the problem.

shell – Linux console text editor with text selection with Windows / Mac style change arrow, cut, exit and save

I have a base of novice terminal users who need to make extremely light text changes from a console (creating git commits, etc.). I would like to set EDITOR to something that keyboard binding looks as much as possible to a standard "web browser text box" with ctrl-s and ctrl-q to save / exit.

I have tried jed, ne, joe, nano and micro, but none of them have all the features that I would like:

  1. Block selection: Shift-Arrow should expand the cursor in the appropriate direction to select a block, just like on Windows / Mac / Gnome / etc.
  2. Copy / Cut / Paste: Must be Ctrl-C, Ctrl-X, Ctrl-V
  3. Save: should be Ctrl-S
  4. Exit: should be Ctrl-Q

  5. Nice to have: an ncurses (ala ne) menu bar that appears when they press Esc

  6. Nice to have: Ctrl-F to find, Ctrl-G to find next

Any suggestion?

rsync – Auto-run shell script – Incorrect output

I am using Rsync to back up a server. I thought I would use Automator to create easy backup executables.
And since the server contains large amounts of data, I have to spread the data over several disks.

If I execute this command in Terminal

/usr/local/bin/rsync -avzh --exclude="/[M-Z]*/*" --delete --progress 'root@x.x.x.x:"/mnt/raid/customers/"' "/Volumes/8TB1/Backup/customers/"

It works very well, it copies all clients whose names start with A-L. M-Z is excluded.

However, when I use Automator with Execute the shell script he copies All, nothing is excluded.
The shell / bin / sh or / bin / bash selected does not seem to make any difference.

I find it weird, why would it work differently when running the same script?
Any takers?

thank you,
To fart

macOS Catalina – 10.15.3

digital geometry – Convex shell of unit circles

(Also posted on Math StackExchange, but I don't know if it belongs here or here).

I know that if we are trying to get the convex hull of the unit circles, we can just shrink the circles to their centers and consider the convex hull of their centers, but I'm trying to prove a few steps intermediaries towards that.

a) Show that the limit of the convex shell consists only of straight line segments and parts of circles.

b) Show that each circle appears at most once within the limit of the convex shell.

(This is from Berg's book of Computational Geometry.)

I kind of have an intuition of why this is true, but my problem is that every time I try to find a solution, I end up looking at a lot of cases, and I have the impression that it is not rigorous or elegant enough because of so many cases. Is there a good way to prove it?

(Note: I know this has already been published in, but I am not satisfied with the answers there, and I am trying to go for something more rigorous.)

shell – Doubt basic commands under linux

I am learning some basic commands under Linux and I am looking for one that shows me information with the following characteristics:

  • name length (without extension) of 5 characters
  • any type of extension
  • a "t" as the second character

I suspect it may be with "about" … but I don't know how to do it. I also know others like "man", "whatis" and "whereis".

In the output, you should get things like:

And not things like:

redhat enterprise linux – Copying files using shell scripts

hellow guys,
please, i need a script shell which can copy files server to another using SCP. and put the files temperament file then copy tmp to the destination /product/serv/nep/

in case if the tmp is empty copy the zipped files from the backup folder /product/backup_dumps and extract inside the destination /product/serv/nep/. NB: i need to compare the zipped files and copy the most recent one. and extract the files inside the destination. and that everything

thanks in advance :] ^ _ ^