Sed directory not found when running R with -e flag

run command line in r
r system command capture output
r system2
r shell()
run shell script in r
r run command line code
r run terminal commands
r system2 no such file or directory

When I try to run the following command: R --slave --no-save --no-restore -e "print('foo')"

I get: /usr/local/bin/R: line 193: /usr/local/Library/ENV/4.3/sed: No such file or directory ERROR: option '-e' requires a non-empty argument

Apparently brew recently moved the ENV folder to a new path (see here). I know I can easily symlink the new sed dir to fix the issue but I wanted to know if there is a better workaround / fix (and eventually if this will be fixed in the R source code).

This happens because brew has changed it's paths in this commit so if you've run brew update in the last 4 days, this is what has caused the breakage.

Credit goes to blindjesse for this answer, which is to brew reinstall -s r.

I ran into some other issues when I tried this though. I didn't have X11 installed and I had a conflict with the tcl-tk which meant that it caused some other failures when it was compiling so:

  1. I installed XQuartz from https://www.xquartz.org
  2. Symlinked it to my homebrew folder ln -s /opt/X11/include/X11 /usr/local/include/X11 (note that your homebrew directory may be different)
  3. brew install homebrew/dupes/tcl-tk brew link --overwrite --force tcl-tk; brew unlink tcl-tk
  4. brew reinstall -s r

And then it worked for me. I think once the r bottle is upgraded this issue should disappear but for the moment this is what I had to do.

IMAP server, dividi r=DIR dvi documentation [DOCDIR) ––pdfdir=DIR pdf documentation append SUFFIX to installed --program-transform-name=PROGRAM run sed ignore unrecognized --enable/--with — — disable – FEATURE do not include flags LD FLAGS linker flags, e. g. -L-lib dir; if you have librari nonstandard directory 'lib  You'll need to first configure your editor to use Unix-like line endings or use dos2unix command to change it automatically, e.g. dos2unix ./NetworkUtility.sh Read more details at: '\r': command not found. If you're using Vagrant, check: Windows CRLF to Unix LF Issues in Vagrant

Upgraded to Sierra, tried the commands above and also the directions here: https://github.com/Homebrew/homebrew-science/issues/4338. After I also reinstalled the R kernel following the instructions here: https://github.com/IRkernel/IRkernel, things started working again. Oy vey.

To reinstall the R kernel, start R in the terminal and enter the following:

install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec()  # to register the kernel in the current R installation

Practical Linux Topics, The optional parameter --recursive command is as simple as -r when In addition, Wget thoughtfully respects the directory structures, which means, in a Wget will even pay attention to the standard robots.txt file commands found in the root is scrutinized by grep, awk and sed once downloaded) is the -O option (not to be  I had a similar need, and came up with this: this command to simply find all the files: grep -i -l -r foo ./* this one to exclude this_shell.sh (in case you put the command in a script called this_shell.sh), tee the output to the console to see what happened, and then use sed on each file name found to replace the text foo with bar:

Rather than having sed's path hardcoded, a simple workaround is to edit the R script and to change line 193 with

SED=$(which sed)

UNIX, CoMMAND/FLAG -q -x -S -w -h -r -n -tz.x Table C.1 (continued) Specifies wide output and does not truncate command lines. Disables header display. Shows running processes only. Use to display name of current working directory. --​verbose --help --version rmdir –p, --parents --help --version sed set setenv sort —​c  Precedes each line by the block number on which it was found. Use this flag to help find disk block numbers by context. The -b flag cannot be used with input from stdin or pipes.-c: Displays only a count of matching lines.-E: Treats each pattern specified as an extended regular expression (ERE). A NULL value for the ERE matches every line.

Linux: Powerful Server Administration, Uday R. Sawant, Oliver Pelz, Jonathan Hobson, William Leemans We also see that it is running, along with the latest logging output from this service and hangs and is unresponsive, and you quickly need to reset it to get it working. the sed command, adding an -Indexes option that disables the directory web site file  Other options may be specified with sed-compatible regex flags – for example, to make the search and replace case insensitive, specify flags="i". The g flag is always specified regardless, so you do not need to remember to include it when overriding this parameter.

Marketing Communications, When you put your ad in a good newspaper, the longer it has been running the harder it hits. as the oposition sed tha wer. There is no better time than the present for artistic, clever and patriotic window supply of flags, which are very cheap, a really attractive display need not cost much money. (See Ayer's Directory). In the previous post, we talked about bash functions and how to use them from the command line directly, and we saw some other cool stuff. Today we will talk about a handy tool for string manipulation called sed or sed Linux command.

Six glorious commands worth getting to know, There is another file in our current working directory here that is the same as the one we've Try running the same cut command on this comma-delimited file, only without This is another good time to mention a handy flag for grep . That's because Excel places \r characters at the end of each line (which show up as  Description. sed is a stream editor.A stream editor is used to perform basic text transformations on an input stream (a file, or input from a pipeline).While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently more efficient.

Comments
  • Did you try reinstalling R? Something seems to be messed up beyond repair.
  • @KonradRudolph I tried reinstalling and it did no t solve the problem.
  • This seems to be a reproducible problem — stackoverflow.com/q/38441722/1968 — it should probably be reported as a bug to Homebrew.
  • I submitted an issue report to Git. Please let me know if you think I should add some more information. github.com/Homebrew/brew/issues/553