OpenSSH: option named 46AaCfGgKkMNnqsTtVvXxYy - windows-10

With the 2017 Fall Creators Update, Microsoft added a version of OpenSSH to Windows 10, which got out of beta and is enabled by default in the recent April Update.
Today I tried to take it for a spin and saw that its usage page lists an option named 46AaCfGgKkMNnqsTtVvXxYy. usage: ssh -46AaCfGgKkMNnqsTtVvXxYy.
Upon running the above command. PowerShell prints the following output:
PS C:\WINDOWS\system32> ssh -46AaCfGgKkMNnqsTtVvXxYy
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
This looks like a version number of sorts.
I have looked in the Microsoft Docs to find more information about ssh and this flag, but to no avail. A documentation page on this website shows the option, but doesn't explain what it should do. To me, it looks like a combination of multiple options, but that doesn't explain why it outputs a version number.
My questions are the following:
Is it normal for ssh to have an option with such a peculiar name?
If yes, where does it originate from?
Is this the expected output for this command?
Is anyone able to provide some more insight on this?

As you can see from the site you linked to they are separate options, not a single option. -4 means one thing, -6 another etc. The reason they’re in one blob is because they don’t take any parameters and they can be combined, meaning -4A would be the same as -4 -A. This saves space on manual pages but is confusing unless you know about it.
After them are all the optiona that do take parameters, like -B.
The version number is shown because -V shows version number and exits and is included there.

Related

How to get all possible value of a certain linux command?

For example, now I want to write a bash script in which I check the name of the running hosting system. The first command I would think of is uname -s. But I want to target some platform that is not available on my machine right now (like Cygwin, MinGW,...) and I want to make sure that I wrote the right name in the if condition. So the question is that how I can list all possible values of uname -s command (to avoid the headache for the wrong condition and who knows what's next...), and even for some commands which have the same characteristics?
Actually, after posting the question, I found out that there is a wiki page about the command uname which gives pretty much the information I need :D Never know that Wiki can be useful like that in this case

How do I full text index/search source code in our Perforce depot?

We use Perforce, recent build (2015.2, we could update to newer if need), on Win2012-R2 server.
We would like full text search to easily find strings across the code base (.cs, .aspx, .less, .resx, etc)
What is an appropriate approach?
The answer should be: p4search
However, where it could be a cool 20-30 minute setup, plan on taking 4+ hours over 1-2 days.
Worse, p4search has been abandoned by perforce. It does not install our run properly on current linux (e.g. Centos 7), requiring edits to startup scripts and general hassle. The indexer gets hung on some files, rdeep diagnostics.
After screwing around w it for a week, we gave up.
So the answer is:
1) Use Open Grok: https://opengrok.github.io/OpenGrok/
or
2) Prepare for a long haul to set up p4search (which, fwiw, also requires perforce Swarm, so you will be setting that up also)
There are lots of such tools out there. Here are two you could start investigating:
Open Grok: https://opengrok.github.io/OpenGrok/
P4Search: https://www.perforce.com/company/newsletter/2014/02/p4-search-search-perforce-server
There is also the built-in p4 grep (perforce docs), with some limitations, see e.g. this good answer to another question, in the server since 2010.1.

Name screen session log using session name

I'm using this very simple .screenrc:
logtstamp on
logfile /tmp/screenlog-%S.log
I tried launching screens with these two methods:
screen -L -S testing
screen -S tester -L
but the filename used is /tmp/screenlog.0S.log. What am I doing wrong? Using Screen version 4.00.03jw4 (FAU) 2-May-06, and according to the manual I should be able to name the log file using the session name
If you look at the man page (man screen) for your (8-year-old?) version of screen, you'll see it's missing the %S specifier. They must have added it since your version. I'm not sure why Ubuntu 12.04 shipped screen from 2006..
P.S. I'd advocate looking into tmux. It's a little bit harder to learn, but a lot more flexible: You can move windows between sessions, You can see multiple windows at once, You can nest sessions inside of other sessions, etc.
Also, if you are just looking to log the output of long-running processes, take a look at nohup.

Is there a Linux command to replicate/replace the "banner" command?

I am writing a script on Red Hat Linux (I forget the version) that needs a header, but the banner command is not there for me to use and I won't be able to get it installed. I read via Google that it may well have been deprecated.
So is there a new version of the command that produces similar results, or a way I can replicate the command, or even just temporarily change the script output so that characters are a different size?
I've tried looking at stty but we don't access via xterm, we log in directly via putty.
In its simplest form, 'banner' is less than a few pages of code (e.g. this one). Perhaps you could just compile and run it from your home directory?
Use some web site, for example http://patorjk.com/software/taag/.
If you need it frequently you can create a script to scrap the result.
BTW, stty has nothing to do with your problem, I don't know why you mentioned it.

How to add a p4sql query as a Perforce custom tool argument?

I'm trying to add this p4sql query as a Custom Tool in P4V (Windows) by adding p4sql.exe as the application and
-s "select * from changes where lcase(description) like '$%$D$%' and p4options='longdesc';"
as Arguments.
When I execute the command and enter '123' as input, the following error comes back:
p4sql error:
Usage: p4sql -h for usage.
Option: 12 is undefined.
What escape mechanism am I missing?
I recently updated the question you referenced and, as I stated, there is a bug in P4V, and P4SQL seems pretty flaky as well. You can get it to work some of the time if you put spaces between the "$%" and the "$D". Change this:
...like '$%$D$%' and...
to this:
...like '$% $D $%' and...
It will work some of the time after making this change, but some searches will still fail as those spaces become part of the search string. I've also noticed some searches fail for reasons I can't explain. I reported this to Perforce last October, and they confirmed it was a bug, but have yet to fix it.
You're better off using one of the solutions mentioned in the other question. Use P4Win or dump the change lists to a file and then search the file.

Resources