Search Results

Search: Posts Made By: Ralph
28,346
Posted By Ralph
This is how it looks on lxterminal before and...
This is how it looks on lxterminal before and after hitting enter after giving an invalid answer:



...
28,346
Posted By Ralph
I mean that it makes for a shorter script. ...
I mean that it makes for a shorter script.


Interesting. I thought the newline was unavoidable because it takes the Enter key to terminate the read call.
28,346
Posted By Ralph
It's still the same as what I posted earlier. A...
It's still the same as what I posted earlier. A bit longer than it has to be because of all the ifs and comments. I like the way you used parameter expansion in your version, but your version didn't...
28,346
Posted By Ralph
Yes, read -n 1 - I did that and it works but I...
Yes, read -n 1 - I did that and it works but I wanted to have it my way. :D

And my final version finally does what I want. :cool:
28,346
Posted By Ralph
This is what I do - the output of my script: ...
This is what I do - the output of my script:
100
101
102
103
104
105
106
107
108
109
110
Do you wish to continue? [Y|n] z
When a user enters an answer other than Y, y, N, n or...
28,346
Posted By Ralph
Array... right. I wasn't thinking straight. Was...
Array... right. I wasn't thinking straight. Was early in the morning then.
Yes, probably quite a few of these escape codes won't work everywhere. Fortunately I don't need to resize the terminal. All...
28,346
Posted By Ralph
Interesting. What do the outer parentheses around...
Interesting. What do the outer parentheses around $(stty size) accomplish? I know they are used to force execution in a subshell. But what are they doing here?

I would have gone for
...
28,346
Posted By Ralph
For some reason LINES is not set in a...
For some reason LINES is not set in a non-interactive shell - even if checkwinsize is on. (I'm using Bash 5.0 but noticed that back in Bash 4.4, Kali Linux (which is Debian 9) and Raspian, too:
$...
28,346
Posted By Ralph
It still duplicates the question lines when the...
It still duplicates the question lines when the cursor is in the middle of the screen.


What do the lines printf "\e7\e[$LINES;120r\e8" and printf "\e7\e[1;${LINES}r\e8" accomplish? I suppose you...
28,346
Posted By Ralph
Cool manual page but no... the page still...
Cool manual page but no... the page still scrolled up and I ended up in the next line, rather than restarting in the same line.

I think I have to check whether the cursor is in the last line of...
28,346
Posted By Ralph
But how do I know the correct position? It keeps...
But how do I know the correct position? It keeps changing as the script proceeds.
28,346
Posted By Ralph
Control cursor position also at bottom of window
I have a slight problem controlling the cursor position in a Bash terminal window. I have a function ask a question and then wait for an answer which is either 'y' or 'n' or a carriage return....
8,439
Posted By Ralph
Thanks. This one works also now: $ find ....
Thanks. This one works also now:


$ find . -name \*"
"\*
./file?with?newlines
Still... if anyone knows how to get the approach with grep to work... would be nice.
8,439
Posted By Ralph
Finding files with newlines in filename
I want to use grep to find files that have newlines in the filename. For example, I have a directory where I create three files:
$ touch file1
$ touch "file 2"
$ touch "file
> with
> newlines"...
Forum: Programming 04-01-2019
5,199
Posted By Ralph
1,804
Posted By Ralph
Typing the address in the browser gives me that...
Typing the address in the browser gives me that standard Apache2 Debian Default page. It could be that the server is in maintenance mode.

But should upgrade packages come from that address -...
1,804
Posted By Ralph
Failure to upgrade
Hi,
I'm trying a routine upgrade of my Linux system (Kali) by doing the usual:
$ apt-get update
$ aptitude safe-upgrade
That usually works fine but this time the apt-get update works as usual but...
3,188
Posted By Ralph
x27 is the hexadecimal value for the single quote...
x27 is the hexadecimal value for the single quote character: '


For a complete set of hex, octal, decimal values for the characters of the English alphabet plus some enlightening context, check,...
2,685
Posted By Ralph
The keys are '$3,$2' and '$2,$3'. Right? The...
The keys are '$3,$2' and '$2,$3'. Right? The values after the entire file has been processed are either 2 or 1.

What I mean is when I leave out the END block nothing get's printed....
2,685
Posted By Ralph
Thanks. That worked well. I also modified my...
Thanks. That worked well.

I also modified my script to avoid duplicates in the first place, using an array to save filenames and compare them to incoming new ones.

It is reassuring that the...
2,685
Posted By Ralph
This escaped=`sed 's|/|\\\/|g' <<< "$LINE"`` ...
This
escaped=`sed 's|/|\\\/|g' <<< "$LINE"``
and this
escaped=`sed 's/\//\\\\\//g' <<< "$LINE"`
is not this
`sed 's/\//\\\//g' <<< "$LINE"`

Thanks for your suggestions, though. I'll look into...
2,685
Posted By Ralph
Right. But my main question is now why does this...
Right. But my main question is now why does this work
$(sed 's/\//\\\//g' <<< "$LINE")
but not this:
`sed 's/\//\\\//g' <<< "$LINE"`
2,685
Posted By Ralph
Confusing sed error message
This situation is extracted from a larger context. My intention for now is to escape the forward slashes in the path of a filename. (Ultimately the LINEs will come from a file.)
while read LINE ; do...
5,943
Posted By Ralph
I tried that. Concerning the auth.log it says: ...
I tried that. Concerning the auth.log it says:


considering log /var/log/auth.log
Now: 2018-12-13 06:15
Last rotated at 2018-12-12 15:15
log does not need rotating (log has been rotated...
5,943
Posted By Ralph
What if I restart the machine? Being in the /run...
What if I restart the machine? Being in the /run directory won't it be recreated as 'system' when the system comes up again?
Showing results 1 to 25 of 50

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