0

I can use every language to realize it, but I want to use shell.

  1. Use shell command or shell script.
  2. For example, I have one word: sport.
  3. I want to get another word: oprst.

Now I want to use shell to bring about it, how to do? Thanks!

thinkerou
  • 1,781
  • 5
  • 17
  • 28

1 Answers1

0

Use the following Shell Script:-

#!/bin/sh

sortedWord=`echo $1 | grep -o . | sort |tr -d "\n"`;
echo $sortedWord;
nandal
  • 2,544
  • 1
  • 18
  • 23