Artificial intelligent assistant

how concatenate two commands? I need to concatenate two commands on shell, I'd have the path result and concatenate with the number of column in the first field. **EX:** #this gives me the path of my path directory like this: `/apps/ent/appli_ent/gen/dev/recep/ENTSMETA.20150824.txt` find $REP_RECEP -name "*META*" -print I'd take the result of this command and concatenate with this: #this gives me the number of my colmuns field. awk -F'|' '{print NF; exit}' When I do this: awk -F'|' '{print NF; exit}' find $REP_RECEP -name "*META*" -print it doesn't work.

The safest way, which can work with arbitrary file names, is to use `find`'s `-exec` option. This will run the specified command on every file/directory found by `find` (from `man find`):


-exec command ;
Execute command; true if 0 status is returned. All following
arguments to find are taken to be arguments to the command until
an argument consisting of `;' is encountered. The string `{}'
is replaced by the current file name being processed [...]


So, you can do:


find "$REP_RECEP" -name "*META*" -exec awk -F'|' '{print NF; exit}' {} \;

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 465d8f708430bb407842f145745289e9