How to grep, cut, cat in a single command?
Would like to know how to cat the below output.
Code:
grep userlist_file /etc/vsftpd/vsftpd.conf | cut -c15- /etc/vsftpd/ftpusers |
Hi,
I'm not sure what it is you are asking. The command you show will look for a line containing userlist_file in the file called /etc/vsftpd/vsftpd.conf, the cut command shows all from char 15 and on. Depending on what is inside /etc/vsftpd/vsftpd.conf the output shown (/etc/vsftpd/ftpusers) could or could not be correct/what you want. Please tell a bit more what it is you want to achieve. |
would like to check the path defined for "userlist_file" and perform cat on it.
|
Maybe you need to assign it to a variable using command substitution, so that you can use its value in subsequent commands, e.g.
Code:
my_file=$(grep userlist_file /etc/vsftpd/vsftpd.conf | cut -c15-) |
Thanks a lot guys, it helps to solved my problem :)
|
Please mark as SOLVED
|
Great, thanks for the info grail
|
All times are GMT -5. The time now is 10:39 AM. |