Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing file directly to nano fails with sighup or sigterm

was want to search for a specific file on my server and directly edit it within nano.

i tried it like this, but it wont work

find -name file.php | xargs nano $1

the file is found, but it wont work like that

Received SIGHUP or SIGTERM

how to do that proberly?

like image 408
easteregg Avatar asked Oct 10 '14 09:10

easteregg


2 Answers

Another solution is to use backticks if you have to use other command. It's for example useful with git status:

nano `git status | grep modified | awk '{ print $2 }'`

Or, with find:

nano $(find -name file\*.php)
like image 117
Rafał Wrzeszcz Avatar answered Nov 06 '22 02:11

Rafał Wrzeszcz


i found the solution in using find intern exec function

# find -name file.php -exec nano {} \;
like image 37
easteregg Avatar answered Nov 06 '22 02:11

easteregg