Questions tagged [unix]

NOTICE: All Unix questions must be related to programming; those that aren't will be closed. Use this tag only if your question relates to programming using Unix APIs or Unix-specific behavior, not just because you happen to run your code on Unix. General software issues should be directed to Unix & Linux Stack Exchange or to Super User.

Tag usage

The tag can be used for Unix system programming related problems. The tag can also contain programming questions about using the Unix platform. For non-programming Unix usage questions, visit the Unix & Linux Stack Exchange site.

Background

Unix was developed as an in-house operating system for AT&T, but in the 1980s became both a prime academic operating system (with U.C. Berkeley's version, called BSD, being the reference platform for development of what would become the Internet) and a commercial success in the form of AT&T's System V, Microsoft/SCO's XENIX (PCs) and various workstation versions from Sun, Silicon Graphics, and others.

In the 1990s, Sun's Solaris and the free Unix clone Linux would rise in popularity. Linux is largely Unix-compatible but lacks the trademark. Currently, Unix is commonly found on server platforms; the primary desktop variant is Mac OS X, based on BSD.

Apart from its command-line interface, most "Unices" support the standardized X Window System for GUIs. (So does Mac OS X, but its primary GUI is Apple's proprietary Quartz.)

The various Unix implementation (and to a lesser extent, clones such as Linux) are unified in a standard called POSIX. C has been its primary programming language since the 1970s, but many other languages are available.

Read more

47509 questions
23
votes
3 answers

Haskell performance implementing unix's "cat" program with Data.ByteString

I have the following Haskell code, implementing a simple version of the "cat" unix command-line utility. Testing performance with "time" on a 400MB file, it's about 3x slower. (the exact script I am using to test it is below the code). My questions…
statusfailed
  • 738
  • 4
  • 15
23
votes
2 answers

Killing a subprocess including its children from python

I'm using the subprocess module on python 2.5 to spawn a java program (the selenium server, to be precise) as follows: import os import subprocess display = 0 log_file_path = "/tmp/selenium_log.txt" selenium_port = 4455 selenium_folder_path =…
afroulas
  • 231
  • 1
  • 2
  • 4
23
votes
2 answers

Unix commandline history substitution ^foo^bar (for multiple replacements)

Occasionally I use the bash command to replace string in previous command: ^foo^bar Today I wanted to make the replacement in the following line for replacing all occurrences of checkbox with `radio: $ git mv _product_checkbox_buttons.html.erb…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
23
votes
4 answers

Git clone "fatal: I don't handle protocol 'ssh'"

I've created a repository in my local machine and asked a colleague to clone it, but it's saying it can't handle the SSH protocol. In my computer the repository is at /devel/scripts.git, and there's an user called devel with access to that folder.…
igorsantos07
  • 4,456
  • 5
  • 43
  • 62
23
votes
4 answers

gdb: breakpoint when register will have value 0xffaa

Can I set the breakpoint/watchpoint/smth else in gdb for register value? I want to break when $eax will have value 0x0000ffaa. Is it possible with gdb or dbx or any other unix debugger?
osgx
  • 90,338
  • 53
  • 357
  • 513
23
votes
2 answers

What is the point of System.err?

In UNIX, I'm supposed to write a Java file that will print "EXIT 1" to the standard error, and then exit with a status of 1. Here is my approach.. System.err.println("EXIT 1"); System.exit(1); Is this what I'm supposed to do? If so, how am I…
Gavin Z.
  • 423
  • 2
  • 6
  • 16
23
votes
6 answers

Difference between write() and printf()

Recently I am studying operating system..I just wanna know: What’s the difference between a system call (like write()) and a standard library function (like printf())?
CSnerd
  • 2,129
  • 8
  • 22
  • 45
23
votes
3 answers

How to download a file from HTTP URL?

I know how to use wget to download from FTP but I couldn't use wget to download from the following link: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE46130&format=file If you copy and paste it in the browser, it'll start to download. But I want…
olala
  • 4,146
  • 9
  • 34
  • 44
23
votes
4 answers

MySQL Command not Found [MAMP]

I'm working to set up my MySQL server using MAMP. Current Status: Downloaded MySQL, MAMP Running MAMP: MySQL Server is green, plus it appears as a process in activity monitor I tried: $ mysql -bash: mysql: command not found I saw some tutorials…
IdeoREX
  • 1,455
  • 5
  • 22
  • 39
23
votes
19 answers

Keeping dot files synched across machines?

Like most *nix people, I tend to play with my tools and get them configured just the way that I like them. This was all well and good until recently. As I do more and more work, I tend to log onto more and more machines, and have more and more stuff…
Steve Klabnik
  • 14,521
  • 4
  • 58
  • 99
23
votes
3 answers

Using sed between specific lines only

I have this sed command for removing the spaces after commas. sed -e 's/,\s\+/,/g' example.txt How can I change it that, it will make the modification between only specific line numbers. (e.g. between second and third lines).
hackio
  • 776
  • 2
  • 8
  • 18
23
votes
2 answers

LOAD DATA INFILE on remote machine

How would I do the following command, with a local file, on a remote database (different machine) ? $MYSQL_PATH/mysql -u root -h remote.net files -e " LOAD DATA INFILE '$1' INTO TABLE $TABLE_NAME FIELDS TERMINATED BY ',' (size,…
David542
  • 104,438
  • 178
  • 489
  • 842
23
votes
3 answers

How can I implement my own basic unix shell in C?

I'm a newbie to process and thread management. My Shell should understand PATH environment variable. It can be set and modified. It runs in two ways -interactive & batch mode. Shell is capable of taking more than one job like ls;ps;wc file;cal. I…
Alex Xander
  • 3,903
  • 14
  • 36
  • 43
23
votes
5 answers

Unix tar: do not preserve full pathnames

When I try to compress files and directories with tar using absolute paths, the absolute path is preserved in the resulting compressed file. I need to use absolute paths to tell tar where the folder I wish to compress is located, but I only want it…
user1082754
23
votes
5 answers

Using grep for multiple search patterns

Consider I have the following stream of data: BODY1 attrib1: someval11 attrib2: someval12 attrib3: someval13 BODY2 attrib1: someval21 attrib2: someval22 attrib3: someval23 BODY3 attrib1: someval31 attrib2: someval32 attrib3: someval33 I…
amphibient
  • 29,770
  • 54
  • 146
  • 240