Search Results

Search: Posts Made By: Lem
2,004
Posted By Lem
I don't think so. How can you have a file whose...
I don't think so.
How can you have a file whose name contains the / character?
1,739
Posted By Lem
Maybe you could give a look to: man script ...
Maybe you could give a look to:
man script
and/or
man tee
4,884
Posted By Lem
Hi! Of course zaxxon is right. However......
Hi!
Of course zaxxon is right.

However... this below is a bash function I use to telnet my tplink router and reset its adsl connection to my provider.

adslreconnect () {
( echo...
9,718
Posted By Lem
Ok. So we have a sequence of chars (a -, then...
Ok. So we have a sequence of chars (a -, then some digits you may want to use for exclusion, then a .) once and only once in each line. So here it is:

#!/bin/bash

inputfile="/tmp/buddyfile"
cp...
9,718
Posted By Lem
In this file "-94" and alike are not at the end...
In this file "-94" and alike are not at the end of lines, as they were before. So no lines were excluded. You got 50% of 5 lines, so 2 lines (2.5 rounds to 2).

If you want a good excluding...
9,718
Posted By Lem
No, 25% is calculated on the remaining lines...
No, 25% is calculated on the remaining lines (after you excluded two lines).
So 25% of 2 is 0.5, which rounds to zero.

Try: ./program Myfile 50 50 52
You'll get 1 line randomly chosen among 2...
9,718
Posted By Lem
#!/bin/bash inputfile="/tmp/buddyfile" cp...
#!/bin/bash

inputfile="/tmp/buddyfile"
cp "$1" $inputfile
(( $# < 3 )) || {
string="-${3}$"
for ((a=4;a<=$#;a++)); do
string+="\|-${!a}$"
done
...
5,439
Posted By Lem
The problem is indeed to have a proper pause. ...
The problem is indeed to have a proper pause.

Even without a pause the loop works: but not as you expect. Try:
for i in {1..150000}; do print '\a'; done
--
Bye
1,883
Posted By Lem
Another way, perhaps in other circumstances,...
Another way, perhaps in other circumstances, could be to use named pipes. For instance:
$ mkfifo cmd1 cmd2
$ exec 2>/dev/null; echo -e "this\nthat" >cmd1 & echo -e "first\nsecond" >cmd2 & paste...
5,099
Posted By Lem
Single quotes prevent parameter expansion. Use...
Single quotes prevent parameter expansion. Use double quotes instead.
--
Bye
6,167
Posted By Lem
With sed, try: sed -n 's/^ *//;/<PRODUCT...
With sed, try:
sed -n 's/^ *//;/<PRODUCT CODE/,/<\/PRODUCT>/!p;/<PRODUCT CODE/,/<\/PRODUCT>/{/<PRODUCT CODE/h;/<PRODUCT CODE/!H};/<\/PRODUCT>/{x;s/\n//g;p}' <inputfile

If you want to change your...
9,718
Posted By Lem
## Let's say that: ## the number of lines in...
## Let's say that:
## the number of lines in your file is 200 (range=200);
## you want 30% of the lines in your file: percent=30.
## So we'll have that lim= 200 * 30 / 100 = 60.

for...
1,986
Posted By Lem
Pardon? I'm sorry, but I don't know a word of...
Pardon? I'm sorry, but I don't know a word of German.
However Google translator helped me a bit, this time. :)

I thought it was your case, and that you didn't have any other directories at level...
1,986
Posted By Lem
For example: find /folder -maxdepth 4 -mindepth...
For example:
find /folder -maxdepth 4 -mindepth 4 -type f -mtime +20 -delete
--
Bye
4,061
Posted By Lem
Don't you have logrotate (or something alike) in...
Don't you have logrotate (or something alike) in your system?
What's wrong with it?
--
Bye
11,238
Posted By Lem
I guessed he wanted flexibility. First he...
I guessed he wanted flexibility.

First he collects data, then he can use (and reuse) them to calculate as many things as he needs (even easily changing his code).
--
Bye
11,238
Posted By Lem
Don't take it as a solution (it's not), take it...
Don't take it as a solution (it's not), take it as a hint:
#!/bin/ksh

unset array
typeset -a array
while true; do
echo "Input a number (just press ENTER to stop): "
read input
[[ "$input"...
1,713
Posted By Lem
dpkg -S is fine to search, as you wrote, among...
dpkg -S is fine to search, as you wrote, among installed packages.
A more generic search can be performed using apt-file search.
--
Bye
6,803
Posted By Lem
BTW: if you'd like to learn something about what...
BTW: if you'd like to learn something about what UNIX actually is, you could start here: What is UNIX ? (http://www.unix.org/what_is_unix.html)
--
Bye
1,776
Posted By Lem
Maybe: grep "$(eval echo '$name'$count)" ...
Maybe: grep "$(eval echo '$name'$count)"

However, if the OP's shell has arrays...
--
Bye
4,615
Posted By Lem
See whether it helps you: General sudo...
See whether it helps you:
General sudo questions and discussion (http://comments.gmane.org/gmane.comp.tools.sudo.user/2536)
--
Bye
Forum: Ubuntu 10-04-2012
3,786
Posted By Lem
This bash general guide can be of some help,...
This bash general guide can be of some help, too:http://tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.pdf.
--
Bye
6,680
Posted By Lem
sed -n '/fruitend/b blk;H;$b...
sed -n '/fruitend/b blk;H;$b blk;b;:blk;x;s/^\(fruitend\)*\n//;/PATTERN/!P' <file
--
Bye
6,680
Posted By Lem
With sed, try this: sed -n '/^$/b blk;H;$b...
With sed, try this:
sed -n '/^$/b blk;H;$b blk;b;:blk;x;s/\n//;/PATTERN/!P' <file
--
Bye
1,270
Posted By Lem
Without escaping, the expression "s*.txt" matches...
Without escaping, the expression "s*.txt" matches a string that begins with zero or more s, goes on with another char no matter what (matched by the period), then goes on with txt. So it matches...
Showing results 1 to 25 of 181

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