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
  • 133,243
  • 15
  • 236
  • 397
Sir Muffington
  • 739
  • 2
  • 7
  • 21

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
  • 739
  • 2
  • 7
  • 21