←back to thread

2039 points Gadiguibou | 1 comments | | HN request time: 0.001s | source
Show context
klausa ◴[] No.36491947[source]
`pbcopy` and `pbpaste` are one of my most-loved in the list.

Dealing with some minified json, switching to iTerm, doing `pbpaste | json_pp | pbcopy` and having a clean output is _so_ nice.

replies(28): >>36492008 #>>36492015 #>>36492028 #>>36492101 #>>36492108 #>>36492229 #>>36492265 #>>36492890 #>>36492953 #>>36493037 #>>36493127 #>>36493336 #>>36493457 #>>36493802 #>>36494023 #>>36494242 #>>36494325 #>>36495379 #>>36495894 #>>36496866 #>>36497033 #>>36497293 #>>36497589 #>>36497973 #>>36498181 #>>36498558 #>>36498586 #>>36535798 #
nine_k ◴[] No.36493127[source]
Those are so useful that I wrote trivial shell functions that do the same under Linux.
replies(1): >>36493204 #
timf ◴[] No.36493204[source]
Since I'm bouncing between OSX and Linux a lot, I have a shell script with the same name on each that boils down to:

  if [ `uname` == "Darwin" ]; then
    pbcopy
  else
    xsel --clipboard
  fi
replies(1): >>36494251 #
cerved ◴[] No.36494251[source]
why not just alias?
replies(1): >>36500438 #
1. timf ◴[] No.36500438[source]
Could be an alias, I have a limited set of aliases for each type of system. But I keep a repository of hundreds of personal shell scripts and it fit better there.