Created
November 30, 2009 23:56
-
-
Save mick/245898 to your computer and use it in GitHub Desktop.
loops the hadoop fs shell command to make it interactive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# starts an interactive shell to the hadoop file system. | |
# Written by David M. Thompson, 2009 | |
CMD="hadoop fs -" | |
echo | |
while [ 1 ] | |
do | |
echo -n "hdfs> " | |
read ANSWER | |
if [ "$ANSWER" == 'exit' ] | |
then | |
break | |
fi | |
$CMD$ANSWER | |
done | |
echo "goodbye." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice and handy. Would be better if we add handling if user hits enter key. Something like this,