Jump to content

Fun SCOX stock script


thinkliberty
 Share

Recommended Posts

##!/bin/sh
#getscox - Free to use and modify!!
# Colors for output
red='\E[31;40m'
green='\E[32;40m'
white='\E[37;40m'
yellow='\E[33;40m'
blue='\E[34;40m'
lblue='\E[36;40m'
bold="\033[1m"
normal="\033[0m"

links -source "http://finance.yahoo.com/d/quotes.csv?s=SCOX&f=sl1d1t1c1ohgv&e=.csv" > scox.csv
ARRAY=(`sed s/[,\"]/\ /g < scox.csv`)
COMPANY=${ARRAY[0]}

SIGN=${ARRAY[4]:0:1}
if [ "$SIGN" = "+" ];
then COLOR=$green
else
COLOR=$red
fi

echo -en $bold"Company:" $yellow$COMPANY$normal
echo -en $bold "      Date:" $yellow${ARRAY[2]}$normal
echo -e $bold "       Time: " $yellow${ARRAY[3]}$normal
echo -en $bold"Current:" $yellow${ARRAY[1]}$normal
echo -en $bold "      Change: "$COLOR ${ARRAY[4]}$normal
echo -e $bold "      Volume: "$yellow ${ARRAY[8]}$normal
echo -en $bold"Open:" $yellow${ARRAY[5]}$normal
echo -en $bold "         Day's High:" $blue${ARRAY[6]}$normal
echo -e $bold " Day's low:" $lblue${ARRAY[7]}$bold
echo

tput sgr0

Link to comment
Share on other sites

script attached as file :deal:

 

You need to have links installed to use it to install it open konsole and type

su (it will ask for your root password)

urpmi links

exit

 

Now make the script executable type

chmod a+x getscox

 

Then run the script type

./getscox

or

sh getscox

getscox

Edited by thinkliberty
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...