0

I wrote the following rather primitive alias:

alias unshorten="curl -k -v -I $1 2>&1 | grep -i '< location' | cut -d ' ' -f 3"

It's meant to unshorten the shortened link and then print out the real link without visiting the site itself. But when I try it out with a link it throws out this:

cut: 'https://testlinkhere.com': No such file or directory

What am I doing wrong?

ilkkachu
  • 138,973
Sir Muffington
  • 1,286
  • 3
  • 8
  • 23

1 Answers1

0

Thanks to the comments above I rewrote it into a function and it works wonders:

unshorten () {
curl -k -v -I  "$1" 2>&1 | grep -i '< location' | cut -d ' ' -f 3
}
Sir Muffington
  • 1,286
  • 3
  • 8
  • 23