3 ms·
That wouldn't really make sense at all. Can you name any commands or interfaces that take the variable before the argument?
by nostalgiac 10y ago
That wouldn't really make sense at all.
Can you name any commands or interfaces that take the variable before the argument?
- nickysielicki 10y ago/etc/init.d/<variable> <command>
- nostalgiac 10y agoThose aren't variables though, you are referencing specific files.
- nickysielicki 10y agoHow about egrep, then?
- dredmorbius 10y agoDepending on what you're looking for, grep may or may not. grep <pattern> <file> Convenient when you're looking for <pattern> in a bunch of <file> (and for some reason cannot glob or list them). Less so if you're looking for a bunch of <pattern> in some one <file>. I've been known to write one-liner shell functions to put the variable component of a list of commands at the end of the commandline for easy editing.
- vacri 10y agocp, rm, rsync, scp tar... cp [list of a great many items] [here] or service service [item] [action] whereas systemd is systemctl [action] [list of great many items] There appears to be no hard and fast rule, though - argument ordering is different to flag ordering (-f -z etc). I never see anyone put flags at the end, though plenty of tools work fine that way. My problem with systemctl is that it's so woeful to tab-complete. At 'syst[TAB]c[TAB]', you may as well just type out the whole thing, because tabbing only saves you two characters. Why not just take 'ctl', that doesn't seem to be taken by anyone?
- JdeBP 10y agoGNU toolset: cp -t [here] [list of a great many items] And there is one area outwith Unix but still at the command line where one does sometimes see people putting flags at the end (even though this is not the documented syntax): dir *.txt /s Be wary of the service command, incidentally. * http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/bsd-service-command.html http://homepage.ntlworld.com./jonathan.deboynepollard/Softwa... As for "ctl": Bear in mind that there are a lot of "ctl" commands. initctl (from upstart), netctl (from Arch), rcctl (from OpenBSD), pfctl (from OpenBSD), ip6addrctl (from FreeBSD), ntpctl (from OpenBSD), hastctl (from FreeBSD), swapctl (from 4BSD), rctl (from FreeBSD), pppctl (from FreeBSD), smartctl, journalctl, bootctl, localectl, busctl, coredumpctl, hostnamectl, machinectl, timedatectl, loginctl ... Pick unadorned "ctl" for the systemd one, and one begs the question of why systemd alone is special enough not to require its name in the command.
- majewsky 10y agoThe "-t" switch in "cp" exists to support the use with xargs, e.g. find /some/directory/ -name *.txt | xargs cp -t all-the-textfiles/ The systemctl interface has the same useful property: systemctl --failed | awk '/.service/{print$1}' | xargs systemctl restart
- bigbugbag 10y agoTab completion has its limits. Using zsh and some added awesomeness from fish: sys<alt+f> and it completes to systemctl sys<ctrl+e> and it completes to the full last systemctl command I used https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting