Search Results

Search: Posts Made By: Lem
1,186
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?
972
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
3,743
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...
5,150
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...
5,150
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...
5,150
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...
5,150
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
...
3,372
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,526
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...
3,910
Posted By Lem
Single quotes prevent parameter expansion. Use...
Single quotes prevent parameter expansion. Use double quotes instead.
--
Bye
4,812
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...
5,150
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,265
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,265
Posted By Lem
For example: find /folder -maxdepth 4 -mindepth...
For example:
find /folder -maxdepth 4 -mindepth 4 -type f -mtime +20 -delete
--
Bye
1,099
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
5,897
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
5,897
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,296
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
2,064
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,213
Posted By Lem
Maybe: grep "$(eval echo '$name'$count)" ...
Maybe: grep "$(eval echo '$name'$count)"

However, if the OP's shell has arrays...
--
Bye
3,867
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,166
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
3,231
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
3,231
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
863
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

 

Featured Tech Videos

All times are GMT -4. The time now is 04:18 AM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy