Виртуальная песочница (тм)

Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Tuesday, October 26, 2010

Exec format error

Иногда shell скрипты берут выходной и отказываются работать, не смотря на то, что получили все права, в том числе и на исполнение (+x):

# chmod 777 test.sh
# ./test.sh
./test.sh: Exec format error

В этом случае нужно проверить, начинается ли скрипт сакраментальным
#!/bin/sh

Иногда это необязательно.
Спасибо Брайену О'Нейлу. :) Read more...

Tuesday, June 10, 2008

Recursive grep

This tip is for grepping a pattern even in the sub-directories of a particular directory in addition to the files in the current directory. Since grep -R <> <> is not available on all flavors, this can be really helpful. The command is as follows:

find -name | xargs grep

The arguments are self-explanatory. The output of find will be xarg'ed to the input of grep and these will be searched for searchstring.

Read more...