unix - Create a new file in same directory where specific file exists -



unix - Create a new file in same directory where specific file exists -

how create new file, b.txt, in every directory file a.txt exists.

for example, if have next directories:

/boo --123.txt --1234.c --a.txt /aboo-- 12354.txt -- a.txt

then in both /boo , in /boo/aboo want b.txt created

how create new file in different directory. if file exists should create new file.

i using command:

touch workdirectory/filename.txt

run base of operations path.

for d in `find . -name a.txt`; base=`dirname $d`;touch $base/b.txt; done

file unix sed

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -