Search Results

Search: Posts Made By: Walter Misar
4,865
Posted By Walter Misar
Breaking down the result line again will work: ...
Breaking down the result line again will work:

result=`grep -n "${id}" getCSV.txt`
if [ -n "$result" ]; then
echo "match found in line $result"|sed 's/:.*//'
echo "$result"|sed 's/[^:]*://'...
4,865
Posted By Walter Misar
Using the -n option to grep will do the trick: ...
Using the -n option to grep will do the trick:


printf "searching, please wait"
result=`grep -n "${id}" getCSV.txt`
if [ -n "$result" ]; then
echo "match found in line $result" >>...
4,865
Posted By Walter Misar
Your read loop doesn't seem to read from the...
Your read loop doesn't seem to read from the downloaded file. Anyway I wouldn't try to emulate grep with shell commands. Instead the loop could be replaced by the use of
grep "${id}" getCSV.txt. For...
3,219
Posted By Walter Misar
The following awk command will do that: awk -F...
The following awk command will do that:
awk -F ">" '/Last Contact>.* d/ { if ($2 >= 2) print }' test.csv

That is, consider only lines measured in days - this scheme will fail if you encounter...
2,040
Posted By Walter Misar
Does your C++ service change its uid at some...
Does your C++ service change its uid at some point? Because core file generation is disabled by default for security reasons in that case; writing the value 2 to /proc/sys/fs/suid_dumpable will help...
3,232
Posted By Walter Misar
If you save that and view it with xdd/od -x, does...
If you save that and view it with xdd/od -x, does it come up as 2e ? If it saves as two bytes instead, it is a font problem.
3,232
Posted By Walter Misar
You will need to make sure that your...
You will need to make sure that your terminal/editor uses an utf8 locale. The locale command will show your settings and specifically you want to set LC_CTYPE to an utf8 locale (for example...
2,896
Posted By Walter Misar
You will need to put the condition into...
You will need to put the condition into parenthesis:

if ((!($InputLine=~/^Date/)) && ($fields[6] eq "VEN")) {
Forum: SuSE 04-02-2015
7,038
Posted By Walter Misar
This is probably the difference between line...
This is probably the difference between line buffering on the shell, and block buffering when the result is piped. To test the theory, just pipe the find through cat in the shell. It will probably...
1,204
Posted By Walter Misar
This depends a bit on the version of the date...
This depends a bit on the version of the date command available on your system. But you could use it to find the month for the day before yesterday.
total_days=`cal $(date -d "-2 days" "+%m %Y") |...
Forum: SuSE 04-02-2015
7,038
Posted By Walter Misar
Ok, so where does the No file found message come...
Ok, so where does the No file found message come from? Sounds like it would be find (linux find doesn't do this btw.). Or isn't that the exact error message?
Forum: SuSE 04-02-2015
7,038
Posted By Walter Misar
I see. Strangely trying your example as is...
I see.

Strangely trying your example as is works for me. Are you using a different shell for the script than on the command line? In any case doing something like bash -x scriptname may help with...
1,204
Posted By Walter Misar
Alphabetical sorting will sort the newest last,...
Alphabetical sorting will sort the newest last, so something like this will work:

sort input.txt|head -n -1|while read file; do rm "$file"; done
Of course if you generate the list via ls ...
Forum: SuSE 04-02-2015
7,038
Posted By Walter Misar
The last line should probably read done >...
The last line should probably read done > searchstring.out, that is redirecting the output.
1,203
Posted By Walter Misar
Screen is probably what you are looking for:...
Screen is probably what you are looking for: https://www.unix.com/man-page/redhat/1/screen/ (https://www.unix.com/man-page/redhat/1/screen/)
4,290
Posted By Walter Misar
You can replace multiple words with: sed -E...
You can replace multiple words with:
sed -E 's/(word1|word2|word3)/,/g'Your sed version might support case insensitive matching:
sed -E 's/(word1|word2|word3)/,/gI'Depending on how your list looks...
2,839
Posted By Walter Misar
Busybox uses its own implementation of awk,...
Busybox uses its own implementation of awk, seemingly one that uses null-terminated strings internally (as opposed to length prefixed, which could handle null characters inside strings). I used...
2,839
Posted By Walter Misar
Busybox awk seems to be unable to output null...
Busybox awk seems to be unable to output null characters, this breaks your complex example.

You can find a bit about it in the second answer's comments here:
shell - How can I output...
2,050
Posted By Walter Misar
I'm not sure what you want to achieve. If you...
I'm not sure what you want to achieve. If you want the the link to point to a new file, removing it and creating a new link will do that:


rm VEUEMASTER.txt
ln -s /sbvnj/kfls/OTHER_FILE...
1,500
Posted By Walter Misar
Hm, works for me: $...
Hm, works for me:


$ f="ABCD_1234_20150324_A02415453.PDF"
$ echo $f|cut -d'_' -f2 | ( read ID2; echo mv $f $(echo $f | sed "s/\(_2015.*\)_.*.PDF/\1_X01$ID2.PDF/") )
mv...
1,500
Posted By Walter Misar
ID2 will be set in the wrong subshell and single...
ID2 will be set in the wrong subshell and single quotes will prevent variable substitution. The following should work:


echo $f |cut -d'_' -f2 | ( read ID2; mv $f $(echo $f | sed...
1,496
Posted By Walter Misar
Separating the substitutions works: awk...
Separating the substitutions works:

awk 'NR>1 { if ($2 ~ /^\(/ ) {$1=""; print "Found error: ", $0} else { sub(/.*:/, "", $1); sub(/.*:/, "", $7); print "No error: " $1 "," $7}}'...
1,496
Posted By Walter Misar
Something like the following should work then: ...
Something like the following should work then:

awk 'NR>1 { if ($2 ~ /^\(/ ) {$1=""; print "Found error: ", $0} else { sub(/.*:/, "", $1); print "No error: " $1 }}'...
1,496
Posted By Walter Misar
It is not clear to me how to distinguish the...
It is not clear to me how to distinguish the error case from the case with no errors. In sample1 we have (variantchecker): in the second column, in sample2 it is NM_004004.5 GJB2_v001.

Can we...
Forum: HP-UX 03-09-2015
2,947
Posted By Walter Misar
This looks a lot like debug messages from ssh -...
This looks a lot like debug messages from ssh - those that appear if a few -v options are given upon connection.
Showing results 1 to 25 of 54

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