Transferring a file directly to nano is not performed using sighup or sigterm

I wanted to find a specific file on my server and directly edit it in nano.

I tried it like this, but it doesn't work

find -name file.php | xargs nano $1 

file found, but it will not work this way

 Received SIGHUP or SIGTERM 

how to do it promptly?

+6
source share
2 answers

I found a solution using find intern exec function

 # find -name file.php -exec nano {} \; 
+1
source

Another solution is to use backticks if you need to use a different command. This is useful, for example, using git status :

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

Or using find:

 nano $(find -name file\*.php) 
+4
source

Source: https://habr.com/ru/post/976557/


All Articles