You are not logged in.

#1 2015-02-11 11:14:13

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

[SOLVED] sed: unrecognized option '--follow-symlinks'

I tried to build AUR package linuxcnc-sim and I got this error:

sed: unrecognized option '--follow-symlinks'

I thought that my sed command is outdated, so I tried to update it:

[ziga@Ziga-laptop linuxcnc]$ sudo pacman -Syy
:: Synchronizing package databases...
 core                                                   120.1 KiB   125K/s 00:01 [##############################################] 100%
 extra                                                 1793.4 KiB   191K/s 00:09 [##############################################] 100%
 community                                                2.5 MiB   384K/s 00:07 [##############################################] 100%
 multilib                                               123.9 KiB  1239K/s 00:00 [##############################################] 100%
[ziga@Ziga-laptop linuxcnc]$ sudo pacman -S sed
warning: sed-4.2.2-3 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) sed-4.2.2-3

Total Installed Size:  0.76 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]

What I discovered was, that my sed command already is the newest version... does anyone have an idea what is wrong?
If I use man sed I get user manual where it says that unrecognized option '--follow-symlinks' is supported:

SED(1)                                                     User Commands                                                    SED(1)

NAME
       sed - stream editor for filtering and transforming text

SYNOPSIS
       sed [OPTION]... {script-only-if-no-other-script} [input-file]...

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.  But it is sed's ability to filter text in a pipeline
       which particularly distinguishes it from other types of editors.

       -n, --quiet, --silent

              suppress automatic printing of pattern space

       -e script, --expression=script

              add the script to the commands to be executed

       -f script-file, --file=script-file

              add the contents of script-file to the commands to be executed

       --follow-symlinks

              follow symlinks when processing in place

Last edited by 71GA (2015-02-13 07:14:59)


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#2 2015-02-11 11:56:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,535
Website

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

Can you post the actual command that is giving the error?  As written, the man page seems to suggest that this option only works along with -i.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-02-11 12:21:59

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

I have looked for sed command in makefiles, src dir and I can't find it... Could you try building this package (linuxcnc-sim) yourself and check if you can do it?

Last edited by 71GA (2015-02-11 12:28:04)


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#4 2015-02-11 12:53:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,535
Website

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

Eh, no*.  Just grep for it:

grep -rl '\--follow-symlinks'

Or look where in the processing the error comes.

* I'd have to install a dozen dependencies including a couple AUR dependencies just to even start building this.  Then, as I have moderately old hardware it could take several hours of building (edit, maybe not, I thought this was a kernel at first) before I see the error you are looking at.  Rather than asking others to spend hours on a problem you are facing, take the minute or two it would take to gather more information on your end.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-02-11 12:59:06

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

Trilby wrote:

Eh, no.  Just grep for it:

grep -rl '\--follow-symlinks'

Or look where in the processing the error comes.

I executed this command in the parent folder and it returns nothing. It looks from the outpt that error happens in PKGBUILD - function pkgver() which has no sed command:

pkgver() {
  cd "$srcdir/$_gitname"
  git log -1 --format="%cd" --date=short | tr -d '-'
}

Last edited by 71GA (2015-02-11 12:59:51)


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#6 2015-02-11 13:00:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,535
Website

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

71GA wrote:

It looks from the outpt that error happens in PKGBUILD - function pkgver() which has no sed command

I doubt that is true - if you show the actual output (or put it in a file sharing site and link to it) we could actually check that.

I did just get the source, and there is indeed no such command in it.  I suspect the bad option is comming from a alias or other environment setting on your system.  Have you tried building as another user and/or on another machine?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2015-02-11 13:37:05

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

Trilby wrote:
71GA wrote:

It looks from the outpt that error happens in PKGBUILD - function pkgver() which has no sed command

I doubt that is true - if you show the actual output (or put it in a file sharing site and link to it) we could actually check that.

I did just get the source, and there is indeed no such command in it.  I suspect the bad option is comming from a alias or other environment setting on your system.  Have you tried building as another user and/or on another machine?

This is new. I have never had any problems like that. I will try that, but it doesn't solve my problem which is on this machine.


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#8 2015-02-11 13:38:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,535
Website

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

No it will not solve it, but it will help diagnose the problem.  All that we have in this thread are suspicion and speculation - if you want to track down the problem we need actual information.  This could be that buld log - or it could be the results of tests, like using other users or machines.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2015-02-12 22:15:20

snakeroot
Member
Registered: 2012-10-06
Posts: 164

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

Is it possible that due to some quirk of your $PATH you are actually calling busybox? I tried

/usr/bin/busybox sed --follow-symlinks 's/new/old/g' somefile

and it threw as the first line of its error

sed: unrecognized option '--follow-symlinks'

which is the same as the error you got. It was followed by a busybox usage summary, so it isn't exactly the same. But it seems to me more likely that you're using the wrong sed than that the script somehow mysteriously makes GNU sed forget one of its options.

Offline

#10 2015-02-13 06:21:08

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

This could really be it. And my PATH is really weird - some inputs are doubled:

PATH=/opt/ARM/eldk/usr/bin:/opt/ARM/eldk/bin:/opt/ARM/eldk/usr/bin:/opt/ARM/eldk/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/ARM/cs_lite/bin:/opt/ARM/unsimgcr:/opt/ARM/ds/bin:/opt/ARM/cs_lite/bin:/opt/ARM/unsimgcr:/opt/ARM/ds/bin

I modify my PATH at startup using ~/.bashrc

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '


export PATH=${PATH}:/opt/ARM/cs_lite/bin
export PATH=${PATH}:/opt/ARM/unsimgcr
export PATH=${PATH}:/opt/ARM/ds/bin

source /opt/ARM/eldk/eldk_init arm

What am I doing wrong in the .bashrc ?

Last edited by 71GA (2015-02-13 06:21:23)


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

#11 2015-02-13 06:27:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

First, don't set it in .bashrc: that is read every time you launch a shell, put it in ~/.profile or ~/.bash_profile so it is read on login.

Then, don't export each of those lines: append your directories using a colon separated list.
See: http://unix.stackexchange.com/questions … th-to-path


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2015-02-13 07:14:38

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 282

Re: [SOLVED] sed: unrecognized option '--follow-symlinks'

jasonwryan wrote:

First, don't set it in .bashrc: that is read every time you launch a shell, put it in ~/.profile or ~/.bash_profile so it is read on login.

Then, don't export each of those lines: append your directories using a colon separated list.
See: http://unix.stackexchange.com/questions … th-to-path

The problem was indeed with my PATH - when I commented out all the added lines in ~/.bashrc I don't get any more errors during compilation.
Now I have to really learn how to properly set PATH - from the link Jason posted I read that it doesn't even need to be exported as it is set at an early
stage. Nice!

Thank you all.


C, ARM, ARM assembly, HTML, CSS, JS, Linux

Offline

Board footer

Powered by FluxBB