Tagged Questions
3
votes
2answers
54 views
Wait for a X window to appear/disappear (in a sane way)
Inside a shell script, I need to wait for a window that has a string on its title to appear, do some action, and then wait for it to disappear, and do some other action.
Until yesterday, I had this ...
2
votes
1answer
34 views
process continous output of synclient
I am using synclient to track the position of finger on the touchpad.
I use the following command.
synclient -m 100 | awk '{print $2,$3}'
This command gives the 'x' and 'y' co-ordinate on the ...
5
votes
4answers
135 views
Hybrid code in shell scripts. Sharing variables
This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is ...
1
vote
1answer
63 views
Safely convert unicode strings to printable characters
I have many HTML files containing mixed unicode strings like \303\243 and printable characters like %s. What I'd like to do is converting the unicode strings into printable characters in a safe way.
...
6
votes
5answers
462 views
How can I have more than one possibility in a script's shebang line?
I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. ...
5
votes
1answer
63 views
Correct handling of Python2 and Python3
What is the correct way running scripts that depend on python2.x but on a system where python3.x is aliased with python.
The solution should take into account the following things :
Python2 ...
2
votes
0answers
34 views
How to determine the current Enhanced Zoom factor in Compiz?
When I use Skype :( need to, rather than want to ), I find that I sometimes want to open the main menu, but it doesn't have a shortcut key assigned to it (well, not one that I can find).
I have ...
2
votes
3answers
131 views
Is there an equivalent of calling the built-in python function help('topics') but in bash?
I would like to explore man pages in bash using something similar to the python help('topics') function. Does this exist in bash?
I know the bash equivalent of python's help('modules') would look ...
4
votes
6answers
246 views
What is the easiest way to check if column A and B values goes both ways with AWK? [closed]
What is the easiest way to check if column A and B values goes both ways?
Output to check:
Mike John
John Mike
Pamela Barbara
Barbara Pamela
Mike Paul
Roger Paul
Desired output
Mike <-> ...
3
votes
2answers
519 views
Sending the output from 'dd' to awk/sed/grep
I'm trying to approximate the computer's write speed using dd:
dd if=/dev/urandom of=/dev/null bs=1K count=10000
which gives the following output
10000+0 records in
10000+0 records out
10240000 ...
3
votes
4answers
286 views
Align a hex text file at 9 bytes each line
I want to align the selected portion of a text file at 9 bytes each column.
For example suppose my text file looks like below.
00 2f c6 b8 29 fd 02 37 11 00 9f 74 34 0b 60 72 38 20 00 9e 61 33 8e ...
1
vote
2answers
79 views
Narrow characters
It would be awesome to modify spark to print narrow characters in for example Gnome Terminal. Is this at all possible with Bash / Python?
1
vote
1answer
285 views
Pipe Python Shell to source-highlight
When I try to make the Python shell get color:
python 2>&1 | source-highlight --failsafe -f esc -s python
the >>> prompt seems to be always delayed by 1 command.
Why is this ...
5
votes
2answers
4k views
Why is this python error message generated whenever I type a nonsense command?
Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this?
$ somenonexistingcommand
Traceback (most recent call last):
...
7
votes
2answers
2k views
How can I rename photos, given the EXIF data?
Let's say I have a bunch of photos, all with correct EXIF information, and the photos are randomly named (because of a problem I had). I have a little program called jhead which gives me the below ...
1
vote
0answers
569 views
Which scripting language is most widespread in system administration tasks? [closed]
I am migrating to Linux and have some experience with the Mac OS X command line/bash. I'd like to automate system admin tasks via scripting, but I am unsure as which language is the most used in the ...