Where can I find out input command from EFI Shell? - efi

does anyone know where can I find out 'input' command in EFI shell?
And i tried two version of efi shell, one is v2.0 and another is v2.31, but these verion, I still find any of input command. So, I don't know how to get input command from efi shell?
So, need you help...

I was looking for input command as well.
Although some websites list an input command for the efi-shell (e.g. https://docstore.mik.ua/manuals/hp-ux/en/5991-1247B/ch04s13.html) they don´t tell the efi version this list shall be valid for. And in shell version 2.1 I can´t find any input argument.
My workaround is to use python scripts. You can find the needed files to use python in efi shell at https://github.com/chipsec/chipsec/tree/master/install/UEFI or https://github.com/tianocore/edk2/tree/master/AppPkg/Applications/Python

Related

message when using find command parmeter -cmin or -mmin " FSUM6372 Unknown option "-cmin" "

while trying to find the file in mainframe server which create last 10 minutes it shows error like
"FSUM6372 Unknown option "-cmin"
Usage: find directory ... expression"
it not accept the -mmin , -cmin , -amin this command
but i want to find the file which create last -10 minutes changed file
how to find it and anyone please help me on this case
find /input \( -name [0-9][0-9][0-9][0-9][0-9]_[A-Z][A-Z].dat \) -cmin -10
FSUM6372 Unknown option "-cmin"
Usage: find directory ... expression
You seem to not know what operating system you're running on, or anything about said operating system, which is concerning. You're running the command on z/OS V2R3, based on the output of uname. z/OS is POSIX compliant, and the options you're specifying on the find command aren't supported, as shown in the documentation.
I can think of two options: first, obtain a version of find that does support said options, or, second, use the tools present on the platform.
For the first option, you can obtain findutils, which includes find, from Rocket Software. Note that this requires an account with them, and may violate your site's security rules. It's also possible that this version is already installed; you should talk to your system programmer.
For the second option, find does have the –newer option, which looks for files created more recently than the specified file. You can use this in conjunction with the touch command's -t option, which will allow you to set a last modified date and time for a given file. So instead of -cmin -10, you would specify -t filename.

Why do which and Sys.which return different paths?

I tried to run a Python script from R with:
system('python script.py arg1 arg2')
And got an error:
ImportError: No module named pandas
This was a bit of a surprise since the script was working from the terminal as expected. Having encountered this type of issue before (with knitr, whence the engine.path chunk option), I know to check:
Sys.which('python')
# python
# "/usr/bin/python"
And compare it to the command line:
$ which python
# /Users/michael.chirico/anaconda2/bin/python
(i.e., the error arises because I have pandas installed for the anaconda distribution, though TBH I don't know why I have a different distribution)
Hence I can fix my issue by running:
system('/Users/michael.chirico/anaconda2/bin/python script.py arg1 arg2')
My question is two-fold:
How does R's system/Sys.which find a different python than my terminal?
How can I fix this besides writing out the full binary path each time?
I read ?Sys.which for some hints, but to no avail. In particular, ?Sys.which suggests Sys.which is using which:
This is an interface to the system command which
This is clearly (?) untrue; to be sure, I checked Sys.which('which') and which which to confirm both are pointing to /usr/bin/which (goaded on by this tidbit):
On a Unix-alike the full path to which (usually /usr/bin/which) is found when R is installed.
To the latter, on a whim I tried Sys.setenv(python = '/Users/michael.chirico/anaconda2/bin/python') to no avail.
As some of the comments hint, this is a problem that arises because the PATH environment variable is different for programs launched by Finder (or the Dock) than it is in the Terminal. There are ways to set the PATH for Dock-launched applications, but they aren't pretty. Here's a place to start looking if you want to go that route:
https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications
The other thing you can do, which is probably more straightforward, is tell R to set the PATH variable when it starts up, using Sys.setenv to add the path to your desired Python instance. You can do that for just one project, for your whole user account, or for the whole system, by placing the command in a .Rprofile file in the corresponding location. More information on how to do this here:
https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html

run windows command from R

In windows 7 at run prompt, this command succeeds in launching the .exe with the the optional input file "test2.dat"
c:/Program Files (x86)/IEUBKwin1_1 Build11/IEUBKwin32.exe k:/Project/EPA.Pb.IEUBK/batch.io/input/test2.dat
I want to do the same thing from within R.
In R, this command succeeds in launching the same .exe
shell.exec("c:/Program Files (x86)/IEUBKwin1_1 Build11/IEUBKwin32.exe")
But I've been unable to find a solution within R that will launch the .exe with the optional input file. I've looked at shell(), shell.exec() and system() but I could not find the right incantation that will pass the optional input file to the .exe.
Any thoughts?
Typing into the normal cmd.exe-promt a command including spaces as in C:\Program Files (x86)\... does not work:
The Command "C:\Program" could not be found.
Typing in the same command with double quotes does work. E.g.:
"C:\Program Files (x86)\7-Zip\7z" -a ...
To get it to work in R, you can use single quotes (') to mark a R string and double quotes (") for the command itself. Actually, you have the possibility of three different quotes to use (backtick is the third one `, see here for more information). Or you use escapes as mentioned in the answer of #Frank.
system('"C:/Program Files (x86)/IEUBKwin1_1 Build11/IEUBKwin32.exe" k:/Project/EPA.Pb.IEUBK/batch.io/input/test2.dat')
In addition ?system mentions not just to use shell in windows but also system2 as alternative:
...This means that it cannot be assumed that redirection or piping will work in system (redirection sometimes does, but we have seen cases where it stopped working after a Windows security patch), and system2 (or shell) must be used on Windows.
But for me system works totally fine not using piping or redirection.
shell.exec() is used for opening files associated in your OS.
in your case, the shell command should be preferred but you need to take care of spaces in your filenames and mask quotaion marks.
Please try:
shell("\"c:/Program Files (x86)/IEUBKwin1_1 Build11/IEUBKwin32.exe\" k:/Project/EPA.Pb.IEUBK/batch.io/input/test2.dat")

Unix command to print directory structure in the form of a tree?

I am a newbie to UNIX, i want to print tree structure of files in a directory. below image is example in DOS, what will be the command of Unix to achieve same objective
I think you are looking for the "tree" command. If you are having issues running it you might have to find out how to install it on your specific distribution. For ubuntu installs you can find instructions here:
https://askubuntu.com/questions/507588/not-able-to-install-tree-comand-in-ubuntu
Not sure what you mean by "on Unix". What OS are you running, specifically? Tree should be compatible on Unix systems. You may just have to compile it for your particular OS.
This command prints output like the following (on cygwin):

Zsh wants to autocorrect a command, with an _ before it

I just started using Zsh lately for some of the integrated support in the shell prompt for my Git status etc.
When I type in:
ruby -v
to confirm the version of ruby I'm running, Zsh asks if I want to change the command to _ruby. Well after saying no at the prompt and the command completing as expected I continue to get the question at the prompt after confirming my command is correct.
I'm assuming there is a completion file or something of the sort.
Thanks
Update:
The shell is no longer trying to complete _ruby, it stopped responding after closing the shell a few times some how.
I tried to clean the file up several times but there is a "opts" variable that is 50 or more lines long and the lines are all ran together, some lines more than 150 characters. Maybe I could email an attachment to you if you still want to see it.
I sincerely apologize for the messy post.
This is command autocorrection, activated by the correct option. It has nothing to do with completion. You're seeing _ruby because zsh thinks there is no ruby command and it offers _ruby as the nearest existing match.
If you've just installed ruby, it's possible that zsh has memorized the list of available command earlier, and it won't always try to see if the command has appeared in between. In that case, run hash -rf. Future zsh sessions won't have this problem since the ruby command already existed when they started.
Sometimes, when you change your PATH, zsh forgets some hashed commands. The option hash_listall helps against this. As above, if you can force zsh to refresh its command cache with hash -rf.
You could make an alias:
alias ruby='nocorrect ruby'
It's what I did when zsh kept asking me if I meant .meteor when I typed meteor because auto-correct is still useful from time to time.
I find the autocorrect feature can get annoying at times. So I do in my ~/.zshrc,
DISABLE_CORRECTION="true"
I had the same problem even when the command is not installed.
I can solve it using the CORRECT_IGNORE variable in my .zshrc
# OPTs to enable
setopt HASH_LIST_ALL
setopt CORRECT
# Zsh variable to determine what to ignore,
# in this case everything starting with _ or .
CORRECT_IGNORE="[_|.]*"
I hope it helps to you or anyone with this issue
Sometime ago after an update, I got command auto-correction enabled which I don't want. If the same happened to you and you want to revert it, in the ~/.zshrc file you'll have make it:
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
or comment it as per bellow:
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
Just a note, on my zsh (version 5.7.1 on macOS), the DISABLE_CORRECTION didn't work.
I saw in my .zshrc file the following two lines, which I then commented out
setopt CORRECT
setopt CORRECT_ALL
That did it for me.

Resources