Search Results

Search: Posts Made By: rovf
3,707
Posted By rovf
You can configure vim to not add the newline at...
You can configure vim to not add the newline at the end. Unless your vim is already quite old, try to put into .vimrc a


set nofixendofline

Whether this is a wise choice, I'm not sure. In...
2,777
Posted By rovf
Getting no output just means that your pattern...
Getting no output just means that your pattern doesn't match the content of any line in fileB, or that count is greater than 6. You did not write how you set the variables COL1, COL2 etc. The...
1,930
Posted By rovf
Once more: - Since interpolation of the...
Once more:

- Since interpolation of the variable does not work, as I explained, I suggested that you model your "pattern" not by a variable named PATTERN, but by an alias named PATTERN.

- Also...
1,930
Posted By rovf
In Posix shell, bash, ksh and zsh, splitting the...
In Posix shell, bash, ksh and zsh, splitting the command line into the individual commands, takes place before parameter expansion. Hence, the shell doesn't see the pipe inside your pattern.

BTW,...
5,837
Posted By rovf
I would write tail -n +2(with space). I think...
I would write tail -n +2(with space). I think this is the "most canonical" form. On very old Unixes, the first variants of head and tail did not provide the -n switch. Then, for some time, I found it...
5,837
Posted By rovf
You can also use awk: awk "NR >=...
You can also use awk:


awk "NR >= $from_line && NR <= $to_line {print}" $filename
1,632
Posted By rovf
This is not correct. While the maximum line...
This is not correct.

While the maximum line length of a bash command line depends on the operating system where bash is running, I am not aware of systems where this length would be less than...
1,160
Posted By rovf
For instance using grep: grep -v '[^ ] [^ ]'...
For instance using grep:

grep -v '[^ ] [^ ]' your_file
3,038
Posted By rovf
I guess you mean that you want to *rewrite* it as...
I guess you mean that you want to *rewrite* it as a shell script (because Windows Batch is so different from all reasonable shell languages that the idea of "conversion" does not really apply).
...
2,973
Posted By rovf
So, basically, you want to test, whether a number...
So, basically, you want to test, whether a number containing a decimal point is larger than 600?

If you are using Zsh as a shell, you have decimal arithmetic, and can simply compare the number you...
2,804
Posted By rovf
I don't think it is "a line", but several lines;...
I don't think it is "a line", but several lines; at least it follows from his comment. So in any case, he must have some program which extracts a set of lines from the input file and writes these to...
1,250
Posted By rovf
Interesting point. I tried it with a 300MB file,...
Interesting point. I tried it with a 300MB file, using Cygwin grep, and searching for a fixed string with various settings. I repeated each run 3 times. Here the times

with -F:

0.27s user 0.08s...
1,049
Posted By rovf
Since you are mentioning cksum, I assume that you...
Since you are mentioning cksum, I assume that you mean the CRC checksum.

Look at this article for a Pure-Perl implementation:

Perl-only CRC32 function (without C code)...
998
Posted By rovf
For a HERE document written in the OP's way,...
For a HERE document written in the OP's way, wouldn't the EOF have to be in the leftmost column?
8,245
Posted By rovf
Scotts solution has the disadvantage that, if...
Scotts solution has the disadvantage that, if someone would enter 00 as the second number, you would still get a division by zero.

In general, I prefer testing numerical values in numerical...
848
Posted By rovf
{ head -n -1 complex.gro; cat lig.gro; tail -n 1...
{ head -n -1 complex.gro; cat lig.gro; tail -n 1 complex.gro; } >combined.gro
2,199
Posted By rovf
The echo-line doesn't make any sense. You are...
The echo-line doesn't make any sense. You are writing something to the bitbucket? What for? Also, you create a variable DATE, but never use it. Finally, shell scripts which really loop permanently...
1,948
Posted By rovf
This is possibly a duplicate posting to the...
This is possibly a duplicate posting to the thread

https://www.unix.com/shell-programming-and-scripting/275073-script-check-files-existence-inside-directory.html?posted=1#post303006244

which...
3,123
Posted By rovf
Some people are more choosy than others! :D
Some people are more choosy than others! :D
3,123
Posted By rovf
It is of course a matter of taste. I personally...
It is of course a matter of taste. I personally don't like your solution so much, because it globs for the files twice (in the while- and in the for-loop), which makes maintenance more difficult...
3,123
Posted By rovf
You can wrap your for-loop by an infinite loop,...
You can wrap your for-loop by an infinite loop, end exit the script once you did your calculation:


while true
do
for ...
do
...
exit 0
done
sleep 123
done
5,613
Posted By rovf
If it waits for the full 30 minutes, it means...
If it waits for the full 30 minutes, it means that expect does not see the string you are waiting for.

You are writing
expect -exact "(.*)## $"

which means that you are waiting for the string...
4,677
Posted By rovf
Let's line out the basic idea: I would first...
Let's line out the basic idea:

I would first read the content of each directory into a separate array, in this case 3 arrays (A, B, C). Then I would set up an associative array (let's call it...
10,533
Posted By rovf
if [[ NF == 10 && $retval -eq 1 ]] will...
if [[ NF == 10 && $retval -eq 1 ]]

will always evaluate to false, because the constrant string NF is not equal to the constant string 10.
3,246
Posted By rovf
Like Don Cragun said, I really don't see a point...
Like Don Cragun said, I really don't see a point in your goal, and why you try to reinvent cron, but if you really want to do:

You are thinking of an infinite loop. Well, in your example code, you...
Showing results 1 to 25 of 48

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