Search Results

Search: Posts Made By: rovf
5,423
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...
3,736
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...
3,736
Posted By rovf
In addition to what Don Cragun said, please make...
In addition to what Don Cragun said, please make clear which shell you want to use. This can't be infered unambiguously from your code example.
5,423
Posted By rovf
In addition to what Don Cragun said: Which exact...
In addition to what Don Cragun said: Which exact command die you use to get the hex dump output?
3,659
Posted By rovf
Here a solution using Zsh. Assuming that you have...
Here a solution using Zsh. Assuming that you have stored your bank acount number into a variable called 'number', i.e.

number=123456789

you can get your number with the X by
...
2,435
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...
2,435
Posted By rovf
As I already explained, this doesn't work. Why...
As I already explained, this doesn't work. Why don't you try the code which I have suggested?
2,435
Posted By rovf
Maybe something in this way (not tested): ...
Maybe something in this way (not tested):


alias PATTERN="${3:-grep whatever you want here}"

.....

COUNT=$(PATTERN|egrep "${start_tim}|${end_tim}" | awk ... etc etc ...)
2,435
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,...
6,329
Posted By rovf
I can understand that you prefer ksh over bash in...
I can understand that you prefer ksh over bash in general, but I don't see how for this particular case, ksh would give an advantage over bash. I must admit that I'm not proficient at all in ksh, and...
6,329
Posted By rovf
There is no need to have the functions in strict...
There is no need to have the functions in strict order. A function just needs to be known when it is invoked. Hence, if you put all the functions on the top of your script, you can arrange them in...
1,038
Posted By rovf
Be careful with this approach! If you don't...
Be careful with this approach! If you don't understand what you are doing, you can easily end up with code which produces no error and works fine with your current set of data, and blows up or does...
1,038
Posted By rovf
To get familiar with bash terminology, it would...
To get familiar with bash terminology, it would already help to glance over the bash man page, in particular to the titles of the respective chapters. You don't need to understand every detail yet,...
1,833
Posted By rovf
For the sake of clarity, *I* would write it like...
For the sake of clarity, *I* would write it like this:


if [[ -f "$file" ]]
then
(( counter++ ))
elif [[ -e $file ]]
then
echo "$file is not a plain file, but $(file $file)"
else
...
1,833
Posted By rovf
After running ((counter++)), the exit code is 1,...
After running ((counter++)), the exit code is 1, not zero, and hence the continue statement is not executed. The reason is that the value of counter++ is what is stored in counter BEFORE it is...
1,221
Posted By rovf
You never tell Tcl, what parts of the string you...
You never tell Tcl, what parts of the string you are interested in. How can Tcl the conclude, that you want that specific part of your line? Tcl is neither magic nor mind-reading.

In your case,...
3,102
Posted By rovf
You are right! LINENO also works well outside a...
You are right! LINENO also works well outside a function.

As for finding out whether or not you are running bash, there are several ways. First of all, you are running the script, so I would say...
2,077
Posted By rovf
You can do this, but be careful that you don't...
You can do this, but be careful that you don't run into a race condition, if the script is started twice at nearly the same time. Also, if someone deletes or manipulates your "control file", this...
3,102
Posted By rovf
Are you sure, that the code being executed is...
Are you sure, that the code being executed is inside a bash function? From my understanding of the bash man page, LINENO is not defined outside of functions.
2,220
Posted By rovf
Columns separated by Escape characters! And I...
Columns separated by Escape characters! And I thought I have already seen all the weirdnesses of the world!

Extracting one column can be done by the cut command. See man cut. You can specify the...
4,811
Posted By rovf
I don't know what you mean by checking a size,...
I don't know what you mean by checking a size, but the usual way to retrieve the size for a single file, is to use the stat command. The way to use this command differs between Unix platforms, and I...
4,811
Posted By rovf
Aside from what RudiC already correctly stated:...
Aside from what RudiC already correctly stated: What do you mean that you "can not go inside a folder"? Does it mean that you don't have neither r- nor x-permission to access the folder?

Ronald
6,379
Posted By rovf
What do you mean by "matching". Being literally...
What do you mean by "matching". Being literally equal? Or are you thinking of some kind of pattern matching?

Also, specify which shell you want the script to run in. This might be an important...
6,379
Posted By rovf
The question is incomplete: Do you require...
The question is incomplete:

Do you require that the header is EXACTLY like the one you posted? In this case, there is nothing CSV-specific in your question. Instead, the problem boils down to...
6,789
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...
Showing results 1 to 25 of 244

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