Reputation: 6720
I would like to know why the following command is not working in Bash and how it's possible to make it run:
/etc/init.d/{httpd,nscd} status
Thanks
Upvotes: 0
Views: 222
Reputation: 11
That does not work because it only expands the the path. Try this.
$ echo /etc/init.d/{httpd,nscd} status
$ /etc/init.d/httpd /etc/init.d/nscd status
Upvotes: 1
Reputation: 123448
Your command doesn't work because it'd execute:
/etc/init.d/httpd /etc/init.d/nscd status
One way of achieving what you want would be to make use of a loop:
for util in /etc/init.d/{httpd,nscd} ; do
${util} status
done
Upvotes: 6