Shell/Bash command not found: browse - bash

I have a bash script written back in 2011 which has this command among others:
browse $PWD
My script fails to run, thus I tried to execute just that command and I get this error:
zsh: command not found: browse
Searching on google gave me no results. Where is the underlying issue? Is my PC lacking some package or is this command no longer used and thus should be replaced?
For information I am using MacOS.

I have never heard of browse. The closest thing I can think of is browsh, and despite being very cool (for watching youtube in the terminal...), I don't think it's as old as 2011.
There were no package matches for browse in apt search (ubuntu 18.04 LTS). I grepped browse in every description (ie apt show) for every matching package of apt search browse (which matches 'browser', and more than the just the package name), and none appeared to mention an executable / command actually called browse. Not conclusive, but often commands named differently to the package are mentioned there.
It may have been some other script / program associated with that script. Look in the same place that script came from.
Also, if you post the script it would help. It may be referring to a function or alias that isn't set correctly, or some conflict due to you perhaps running a bash script in the default MacOS shell (ksh). I wouldn't be suprised if it's an error with the script actually (or how you're running it). Have a look where else 'browse' occurs in the script.

Related

Trouble installing haskell: how to adjust PATH variable to add to a shell config file?

I installed Haskell on my MacOS system using ghcup installer. It worked because if I type ghci I am dropped into this interactive shell. However I got this message in the terminal after doing the install:
In order to run ghc and cabal, you need to adjust your PATH variable.
You may want to source '/Users/user1/.ghcup/env' in your shell
configuration to do so (e.g. ~/.bashrc).
Detected bash shell on your system...
If you want ghcup to automatically add the required PATH variable to "/Users/user1/.bashrc"
answer with YES, otherwise with NO and press ENTER.
YES
grep: /Users/user1/.bashrc: No such file or directory
My shell is bash 3.2 But as you can see, when I typed YES it says there is no such file. How do I find my shell configuration file, or resolve this? I'd like to complete the setup correctly here.
And I have to be honest about my level of knowledge here, I don't truly understand what this is asking exactly. Is the PATH variable 'env'?
On macOS, .bashrc does not exist by default. ghcup will create this file, so the command you ran will have worked correctly. However, one of ghcup's subcommands expected to find the file before it was created, and therefore reported that error message. You can safely ignore this.

mkfs.vfat and mkfs.ext3 in CYGWIN

I'm running a bash script in the Embedded Command Line that comes with Quartus II. The bash script was sent to me from someone using linux and I was able to get most of the script to work(removing sudo, changing path, etc.). The only two commands that are still giving me errors are mkfs.ext3 and mkfs.vfat. Are these tucked away somewhere in cygwin that I need to add a path or is there another workaround? I've read some people use mkdofsf but cygwin doesn't appear to have that either.
UPDATE:
Tried using /sbin/mkfs - t vfat and /sbin/mkfs -t ext3 but this left me with a similiar error where mkfs.vfat and mkfs.ext3 were not found.
UPDATE 2: Installed e2fsprogs to solve the error with mkfs.ext3 but this doesn't solve the vfat formatting issue.
These are part of the package e2fsprogs which is available in Cygwin. I've never tried these commands, assuming that access to the raw devices would be blocked by Windows. But I see that cfdisk seems to work. It at least starts up, anyway. So, maybe it is doable.
If they don't work on raw devices, if your scripts are creating file systems on a file or can be modified to do that, that should probably work.
Anyway, e2fsprogs is what you need, but be careful here. Whenever you start making or editing file systems, you have the opportunity to really screw up your system. Just be attentive to what the script is doing, and don't blindly go forward.

Automator: The action “Run Shell Script” encountered an error: cannot execute binary file

I'm trying to run a command line app through Automator "Run Shell Script" on selected files/folders in Finder as QuickAction/Service in OS X 10.14 Mohave.
I keep getting The action “Run Shell Script” encountered an error: “/Users/me/test/test1.zip: /Users/me/test/test1.zip: cannot execute binary file” for any selected items. A selected directory returns : Is a directory at the end.
I've written similar Automator shell scripts in the past and never encounter this error.
I've read every question I could find on [Automator] [shell] and "Automator encountered an error: cannot execute binary file” and am unable to find a solution.
I've added path statement to ensure the executable is in the path. The best solution seems to be to source ~/.bash_profile but I've tried export PATH=/usr/local/bin:$PATH as well.
The executable has proper permissions and is in the path:
→ wl artest
/usr/local/bin/artest
-rwxr-xr-x 1 me admin 14004618 Mar 25 20:46 /usr/local/bin/artest
The same code in a shell script executes perfectly.
The fact that the arguments are the error leads me to believe it's not the script that's the issue. I've tested this by just using the help switch with no other arguments:
#!/usr/bin/env bash
source ~/.bash_profile
artest -h
But get the same errors.
I much prefer to pass all the arguments to artest as it's multithreaded, but I have tried to iterate over the arguments:
for f in "$#"
do
and based on another question and in order to test everything I could think of I left out the explicit all arguments:
for f
do
While this still works in earlier Automator workflows (see below), I fail with the same error.
I've tried adding shebang statements based on other questions here, although my previous shell script workflows work fine without one. I had assumed this was covered in the shell selection menu above, e.g. "/bin/bash"
I've read questions where they state "Run Shell Command" isn't same as running in terminal but honestly I couldn't find a solution nor are actions composed in 10.14 working while my services workflows from previous OS (and Automator) version continue to work fine.
I feel like I'm missing something basic here (or there is a major bug in the new Automator version), but I just can't see it.
This shell script works fine though:
You might need to go into the Security and Privacy system preference and give Automator full disk access.

How to install shell commands to enable the atom command at the command line?

I have been stuck for two days looking for a solution. Could anybody please tell me how to install shell commands in Atom to enable the atom command at the command line under Windows. I know that it is not installed because when I typed which atom, it returns nothing.
Reading your other thread, I understand that you want to install a package who emulates shell commands within Atom. If so, you just have to follow the installation steps for Windows on Atom's website (I think you got confused with this which command story on the other thread, which explains how to install it on Linux and macOS).
I don't really know how to execute programs with command-line in Windows, if you don't master it either, I'd recommend using the graphics mode, and simply open your README.md file with the FILE button, like in any other software.
When you have Atom properly installed, there'll be some packages created to emule a terminal with shell commands, like this one. But this is independant from executing Atom from your computer. It emulates a terminal within Atom. I hope this is a little bit clearer.

Error message on Terminal launch [duplicate]

This question already has an answer here:
How to restore .bash_profile on a mac? None of my unix terminal are working [closed]
(1 answer)
Closed 2 years ago.
I receive this error message each time I launch terminal:
-bash: =/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
You have recently edited one of your shell's startup files and introduced an error.
Probably, ls -lart ~/.bashrc ~/.bash_profile ~/.profile will indicate which one -- if one or more is missing, that's no concern, we just want to see which one out of these you have edited recently. Examine the time stamps and try to remember what you did to change one of these files.
The error probably looks something like
$oopsPATH=/usr/local/bin:$PATH
where you meant to say
PATH=/usr/local/bin:$PATH
but without access to your files, we can't know what exactly is supposed to be there, or how you messed it up.
See also https://askubuntu.com/questions/198730/how-to-restore-bashrc-file/198740#198740
In the common case where you have messed up your PATH so that ls and other commands are unavailable (bash: ls: command not found), you can use the full path (/bin/ls pro ls, etc; though obviously, you have to know the correct path) at least until you can restore your configuration.
PATH=/usr/local/bin:/usr/bin:/bin
is probably a good crutch until you can find the correct default for your OS. You can type that at the prompt, or put it in one of your shell's startup files and start a new shell.
On many platforms, you can find the default user dot files in /etc/skel so if that's present (which unfortunately will not be true for Mac OS, but should be there on most Linuxes):
cp -b /etc/skel/.bash_profile $HOME/
will replace your (presumably broken beyond repair) .bash_profile with the system default one. (Omit the -b option if your OS doesn't have it, but then you'll want to back up your file manually before replacing it.)
Update: This fragment near the top of your .bash_profile is erroneous:
#loginPath
=/usr/local/bin:$PATH
Just take it out; it doesn't seem to do anything useful. There seem to be multiple additional fragments from the MacPorts installer which look wrong, too, but they are just comments. (Perhaps somehow they shouldn't be?)
It seems that you are missing a necessary PATH and that is why it is saying no such file or directory. If, for example, you get this error message when typing in python, it would mean either that (1) python isn't installed; or (2) python isn't on your system path.

Resources