Search Results

Search: Posts Made By: Flavius
3,621
Posted By Corona688
Using a pipe puts the loop into a subshell. Any...
Using a pipe puts the loop into a subshell. Any variable changes inside it aren't reflected outside the loop, and once the loop finishes, the subshell ceases to exist. It's kind of like the...
3,621
Posted By vgersh99
change: cat $_file | while read _line do ...
change:
cat $_file | while read _line
do

done
to

while read _line
do

done < $_file
3,088
Posted By Scrutinizer
I do not know what you are are trying to...
I do not know what you are are trying to accomplish, but try this:
if [ "$_CHAR" -eq "$_CHAR" ] 2>/dev/null || [ "$_CHAR" = "*" ]; then
3,088
Posted By Scrutinizer
Use single = put double quotes around $_CHAR
Use single =
put double quotes around $_CHAR
3,088
Posted By Scrutinizer
Put a space between [ and $
Put a space between [ and $
3,088
Posted By Scrutinizer
Do not put 2>/dev/null inside the brackets
Do not put 2>/dev/null inside the brackets
3,088
Posted By panyam
try with "-o" option instead of "||". ...
try with "-o" option instead of "||".

So,
3,088
Posted By jim mcnamara
You do not need the "2>/dev/null" part in a...
You do not need the "2>/dev/null" part in a boolean (if) construct. It doesn't evaluate.
And. I do not know why your first line works. It should not.

---------- Post updated at 09:01...
3,052
Posted By Scrutinizer
This might work: sed...
This might work:
sed 's/SCSGTI:N="$\([0-9]*,\)\{4\}\(.*\)-->RemoteSPC: \([^," ]*\)\( SSN: \([^," ]*\)\)*\(,Sec:RemoteSPC: \([^," ]*\)\)*\( SSN: \([^," ]*\)\)*",.*/\2,\3,\5,\7,\9/' infile |
while...
3,052
Posted By Scrutinizer
Do you mean like this? $ sed...
Do you mean like this?
$ sed 's/SCSGTI:N="$\([0-9]*,\)\{4\}/GT=/;s/-->RemoteSPC: / SPC1=/;s/SSN: /SSN1=/;s/,Sec:RemoteSPC: / SPC2=/;s/SSN: /SSN2=/;s/",.*//' infile
GT=34622991111 SPC1=1111...
Showing results 1 to 10 of 10

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