This
grep VERSION "./base/internal_version.h" | cut -d\" -f2
won't work and will quit with an error because grep cannot handle ./ in pathnames.
Removeing the ./ works just fine
It would be nice if this can be fixed/added in a next grep version
Sorry if this is the wrong forum, i wasn't sure if it is part of adtools
grep doesn't like ./ in pathnames
grep doesn't like ./ in pathnames
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Re: grep doesn't like ./ in pathnames
I didn't actually think ./ ever worked?
/root dir/ did though?
for example I don't think I could never type
sh ./configure
had to cd to the directory then type sh configure
that aside since it's probably not even applicable anymore, it's a been a few years since I've configured anything
Does dropping into sh first change anything? and what exactly (without me reading the docs) does that grep line set out to do?
It looks like it checks for something then does something if or when it encounters it?
/root dir/ did though?
for example I don't think I could never type
sh ./configure
had to cd to the directory then type sh configure
that aside since it's probably not even applicable anymore, it's a been a few years since I've configured anything
Does dropping into sh first change anything? and what exactly (without me reading the docs) does that grep line set out to do?
It looks like it checks for something then does something if or when it encounters it?
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~
1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x
3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x
3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
Re: grep doesn't like ./ in pathnames
I am in sh, but the line is taken out of a more complex shell command line.Slayer wrote:I didn't actually think ./ ever worked?
/root dir/ did though?
for example I don't think I could never type
sh ./configure
had to cd to the directory then type sh configure myself too
that aside since it's probably not even applicable anymore, it's a been a few years since I've configured anything
Does dropping into sh first change anything? and what exactly (without me reading the docs) does that grep line set out to do?
It looks like it checks for something then does something if or when it encounters it?
It was this exact command that broke the whole process.
I do need to enter the dir before using sh to use ./configure
The command itself looks for base/internal_version.h, greps the information it finds for VERSION inside this file cuts out the needed part and returns it, i.e. "1.3.19" whereas the line in internal_version.h looks something like this
#define VERSION "1.3.19" REVISION
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: grep doesn't like ./ in pathnames
10.RAM Disk:T> grep "hid" ./usb.log
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
10.RAM Disk:T> grep --version
GNU grep 2.5.4
no issue there with ./ so i wonder are you using the right grep?
to make it closer to your example
/RAM Disk>grep "hid" ./T/usb.log | cut -d\| -f2
HID driver
HID driver
HID driver
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
I: [18:56:34] hid.usbfd | HID driver | USB Interface bound
10.RAM Disk:T> grep --version
GNU grep 2.5.4
no issue there with ./ so i wonder are you using the right grep?
to make it closer to your example
/RAM Disk>grep "hid" ./T/usb.log | cut -d\| -f2
HID driver
HID driver
HID driver
Re: grep doesn't like ./ in pathnames
I was trying to do a test case too with this version but every time I introduced the | string it returned the wrong thing, I just put it down to being tired and left it for another day.
I then thought perhaps he is in a different level of directory than the same directory as ./whatever because doesn't ./ mean one directory down from root? eg ../ is two levels down or up? lol
I then thought perhaps he is in a different level of directory than the same directory as ./whatever because doesn't ./ mean one directory down from root? eg ../ is two levels down or up? lol
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~
1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x
3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x
3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
Re: grep doesn't like ./ in pathnames
The test case i provided was ripped from the original line which is part of a bash batch script
It originally something like this (NOT working as i cant access the right site atm)
VERSION = (shell grep VERSION "((rootdir))/base/internal_version.h ! cut /d" -f2)
the double (( are normally waved (
I hate the keyboard on this public pc
I will post the right line when i have the chance and also the workaround
Thanks for trying though
It originally something like this (NOT working as i cant access the right site atm)
VERSION = (shell grep VERSION "((rootdir))/base/internal_version.h ! cut /d" -f2)
the double (( are normally waved (
I hate the keyboard on this public pc
I will post the right line when i have the chance and also the workaround
Thanks for trying though
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: grep doesn't like ./ in pathnames
@Slayer
The Pipe "|" only works in abc-shell in this case.I was trying to do a test case too with this version but every time I introduced the | string it returned the wrong thing, I just put it down to being tired and left it for another day.
Re: grep doesn't like ./ in pathnames
Not sure, but i think i use abc-shell, so pipe should work.broadblues wrote:@SlayerThe Pipe "|" only works in abc-shell in this case.I was trying to do a test case too with this version but every time I introduced the | string it returned the wrong thing, I just put it down to being tired and left it for another day.
I think it comes down to being a path issue when the file in question lies in a sudbir, like
./subdir/file-in-question
then, i think, it refuses to work properly
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: grep doesn't like ./ in pathnames
my example is in a subdir so it has to be more than that.
Re: grep doesn't like ./ in pathnames
There you go
You can try the line
The {srcdir} part will always be translated into "." at least for me, which won´t work then.
You can find internal_version.h here
doesn´t work.VERSION = $(shell grep SCUMMVM_VERSION "${srcdir}/base/internal_version.h" | cut -d\" -f2)
You can try the line
in abc-shell.grep SCUMMVM_VERSION "./base/internal_version.h"
The {srcdir} part will always be translated into "." at least for me, which won´t work then.
You can find internal_version.h here
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg