Search Results

Search: Posts Made By: Ralph
6,550
Posted By Chubler_XL
This is how you use grep: $ find . -print0 |...
This is how you use grep:

$ find . -print0 | grep -z '[\n]'
./file
with
newlines
6,550
Posted By Chubler_XL
I'd use the -name find option to match newlines: ...
I'd use the -name find option to match newlines:

$ find . -name \*$'\n'\* -print
./file?with?newlines
1,882
Posted By Scrutinizer
You would need to leave out the braces: ...
You would need to leave out the braces:

#!/usr/bin/awk -f
!A[$2,$3]++ && !A[$3,$2]++


Everything in awk has the form condition{action}. If the condition evaluates to 1 then the action is...
1,882
Posted By RudiC
You might want to read the input data into...
You might want to read the input data into several variables, not just the one $LINE. Like while read V1 DIR1 DIR2 V2, and the operate on the two DIR variables...
1,882
Posted By Scrutinizer
Assuming the fields in your input file are...
Assuming the fields in your input file are whitespace separated, you could try this approach:
awk '!A[$2,$3]++ && !A[$3,$2]++' file
1,882
Posted By Scrutinizer
Backticks have been deprecated for a long time....
Backticks have been deprecated for a long time. They offer no advantage over $( ... ) and have quoting nesting and escaping issues.

Unless you are writing for a legacy shell like pre-Posix Bourne...
2,559
Posted By RudiC
man sed: q0 and q1 in above script set the exit...
man sed:
q0 and q1 in above script set the exit code to be evaluated in the if ... fi construct.



Wouldn't it be the time NOW to analyse the regex used in the sed script and try to transform /...
2,559
Posted By RudiC
$ if sed -r '/[^0-9+.]|([.]).*\1/q1; /[1-9]/q0;...
$ if sed -r '/[^0-9+.]|([.]).*\1/q1; /[1-9]/q0; q1' <<< $1
then echo valid: $1
else echo invalid value for sleep: $1
fi
1,335
Posted By Don Cragun
Please carefully proofread your posts before you...
Please carefully proofread your posts before you hit the submit button. Like the shells you will be using, the people who read this forum and try to help you with problems you're having tend to read...
2,293
Posted By Don Cragun
You seem to be making this harder than it needs...
You seem to be making this harder than it needs to be and are depending on non-portable features (such as ls -Q or shell arrays). The simple way to process all files in the current directory (no...
2,293
Posted By Scrutinizer
The problem is in for file in $filesToShow The...
The problem is in for file in $filesToShow
The unquoted expansion of $filesToShow with the default IFS means the fields will be split by using white space.

What you could do instead is to use an...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 06:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy