All Questions
Tagged with portability grep
6 questions
1
vote
0
answers
199
views
Why do BSD and GNU grep give different results here?
I distribute a slightly modified version of a public CSV file. To generate the modified CSV file I use a short one-line grep command:
grep -Ev '^([A-Za-zA-Za-z]|[0-90-9]*),' input.csv
Actual project ...
2
votes
1
answer
2k
views
POSIX and Portability | shell scripts | grep -s, grep -q
I am all in for portability in regards to shell scripts.
But I am unsure if I am overdoing it right now.
In this example, we have a function called confirmation, which accepts the very first ...
2
votes
1
answer
1k
views
Availability of deprecated egrep and fgrep commands
Quite often I've seen answers mentioning that egrep is grep -E or fgrep is grep -F and using egrep or fgrep in their answers, even though these are technically deprecated.
So I was wondering if ...
1
vote
3
answers
333
views
How to rewrite grep call from Linux to AIX
In my Linux system in fgrep I am using atributes -m 500 -C 0. But on AIX I didnt see these arguments. So how should I rewrite it? I just read to use awk instead of fgrep but I don't know how.
3
votes
4
answers
11k
views
Test if command accepts a specific option
What is the preferred way to test if a command takes an option? What are the caveats?
As a motivating example, at login my shell aliases grep to add several --exclude-dir options but this option is ...
4
votes
3
answers
25k
views
Search string in many files on HP-UX
I need to find which files (they can have space in the filename) of a directory contains a string using only sh and system's commands (Perl is not an option).
For a few files, this command works fine:...