Search Results

Search: Posts Made By: Ilja
13,423
Posted By Ilja
Now, here's my problem. I'm trying to unlock my...
Now, here's my problem. I'm trying to unlock my encrypted system disk in Ubuntu 10.10. Sometimes I want to enter the passphrase via SSH and sometimes locally. Here's the piece of code that needs to...
13,423
Posted By Ilja
So, I made this code, but it's not working and I...
So, I made this code, but it's not working and I have no idea why.

#!/bin/sh

read VAR < /dev/input/event3

if [ -n "${VAR}" ]; then
echo "Key pressed"
else
echo "No key pressed"
fi...
13,423
Posted By Ilja
None of those solutions will work. It's an...
None of those solutions will work. It's an initramfs script I'm working on, so there will no X11. I guess there is no simple solution to my problem. Thanks anyway.
13,423
Posted By Ilja
sh: Detect key (CTRL/SHIFT/CAPS LOCK) state?
I'm trying to write a shell script that runs periodically and if I'm not at the keyboard, it should do one thing, but if I am at the keyboard, it should do another thing. Therefore I've decided that...
15,497
Posted By Ilja
So, the delimiter can be any (single-byte)...
So, the delimiter can be any (single-byte) character? I never knew that. Thanks a bunch!:b:
15,497
Posted By Ilja
Expand an environment variable in sed, when the variable contains a slash
I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash".
sed -e 's/<HOME_DIRECTORY>/'$HOME'/'This gives me...
5,648
Posted By Ilja
PHP: preg_match_all with multibyte characters?
Hi! I'm trying to separate text into sentences, like this:
$pattern = "/[A-Z]([a-z]|[[:space:]]|,)*[\.\!\?:]*/";
preg_match_all($pattern, $text, $matches);
This works fine unless the text contains...
1,941
Posted By Ilja
Python: $PYTHONSTARTUP ignored
I have the $PYTHONSTARTUP variable set to ~/.pythonrc which contains what I need to have tab completion in the python shell, but when I run python nothing happens. It seems the $PYTHONSTARTUP...
4,062
Posted By Ilja
"Ett äpple." should match.
"Ett äpple." should match.
4,062
Posted By Ilja
PHP: preg_match_all with multibyte characters?
Hi! I'm trying to separate text into sentences, like this:
$pattern = "/[A-Z]([a-z]|[[:space:]]|,)*[\.\!\?:]*/";
preg_match_all($pattern, $text, $matches);

This works fine unless the text...
1,806
Posted By Ilja
Help with options and arguments to a script
I'm trying to write a script that accepts both arguments and options, e.g.

./script -h 1 -m 15 -s 30
[list of arguments]

or

./script
[list of arguments] -h 1 -m 15 -s 30

I'd like for...
23,424
Posted By Ilja
Thanks!
Thanks!
23,424
Posted By Ilja
Sed one-liner to print specific lines?
I need to print specific lines from a file, say 2-5, 8, 12-15, 17, 19, 21-27. How do I achieve this?
2,987
Posted By Ilja
Nice to know. Thank you.
Nice to know. Thank you.
2,987
Posted By Ilja
I solved it echo ${!BAR}
I solved it
echo ${!BAR}
2,987
Posted By Ilja
Evaluate the value of a variable?
I have variables:
FOO="Text"
BAR="FOO"

I'd like to be able to evaluate the variable named as the value of $BAR.
echo $FOO
Text

echo $BAR
FOO

This is what I'd like to do:
echo ${$BAR}...
2,222
Posted By Ilja
Nice! Thank you!
Nice! Thank you!
2,222
Posted By Ilja
ThisIsAPascalStyleIdentifier ->...
ThisIsAPascalStyleIdentifier -> This_Is_A_Pascal_Style_Identifier

The problem is that amongst these identifiers are those that already are the correct case, and some of the identifiers have...
2,222
Posted By Ilja
Putting a character between two other characters?
I need to separate Pascal style identifiers (TheyLookLikeThis) into words separated by an underscore (_).
I've tried sed 's/[a-z][A-Z]/&_&/' but this won't work (obviously). I'd love some help.
Forum: Programming 01-26-2009
3,478
Posted By Ilja
This is actually what I'm trying to do: ...
This is actually what I'm trying to do:

Keyword1 Keyword2 IdPrefix_IdBody_IdSuffix

I want to check that "Keyword1" is actually followed by "Keyword2" etc.
Lines like these should be rejected:...
Forum: Programming 01-26-2009
3,478
Posted By Ilja
Tools for writing a simple syntax checker?
I'm trying to write a small utility for syntax checking. I've tried using Flex/Bison, but these seem too advanced for my task. A simpler tool would be appreciated.
2,246
Posted By Ilja
Thank you a lot!
Thank you a lot!
2,246
Posted By Ilja
Removing duplicates from log file?
I have a log file with posts looking like this:
[arrival time]-[message]-[id number]

Messages can be delivered by different systems at different times. The id number is used to sort out duplicate...
7,257
Posted By Ilja
Python: Bind to port 80 as root, then drop privileges?
I have written a small web server in Python, and now I would like to run it on port 80, but in order to be able to bind to a port below 1024 I need to have root privileges. I don't want to run the...
23,601
Posted By Ilja
This works perfectly. echo "command" | netcat...
This works perfectly.
echo "command" | netcat 100.100.100.1 8080
Unfortunately I don't have the luxury to assume that every system that needs this will have netcat. Still in trouble.
Showing results 1 to 25 of 29

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