Subscribe to A Journey Through My Geek Life        RSS Feed
-----

Some more things that are irrellivant to you that excite me :D

Icon Leave Comment
I've completed my first class. It was easy enough. I'm in my second class, CompTIA Strata Fundamentals. Easy peesey. That's really not what I'm making this entry about, though. I'm making this entry to say this; I've realized that I'm starting to develop the critical thinking and abstract problem solving skills required to become a successful developer. I say this because, while trying to look through my massive .bashrc file, I realized that I needed an easier way. I wrote a short script aliased into my .bashrc that will cat my bashrc, and grep some input.
read INPUT; cat ~/.bashrc | grep $INPUT
I then realized that I had done some other scripting. It seems a bit dirty to me, but it was written to copy a user's .bashrc file into a Dropbox folder so Dropbox would automatically upload it. I would hate to lose the file that I've become so dependent on.
#!/bin/bash
# This script is set to back up eash user's .bashrc file to dropbox.

DATE=$(date +\%Y-\%m)
DAY=$(date +\%d)
DATE_DIR=/home/$USER/Dropbox/bashrc/$DATE
if [ ! -d "$DATE_DIR" ]; then
    mkdir /home/$USER/Dropbox/bashrc/$DATE/
    echo Directory $DATE created.
fi

DAY_DIR=/home/$USER/Dropbox/bashrc/$DATE/$DAY/
if [ ! -d "$DAY_DIR" ]; then
    mkdir /home/$USER/Dropbox/bashrc/$DATE/$DAY/
    echo Directory $DAY created within directory $DATE.
fi

cp /home/$USER/.bashrc /home/$USER/Dropbox/bashrc/$DATE/$DAY/bashrc;
echo .bashrc file has been backed up.

exit 0;

Either way, I really think this is a good thing for me. While scripting, to my understanding, is not nearly as complex as programming, it still uses the same skills as programming, even if it may be on a different level.

0 Comments On This Entry

 

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

September 2014

S M T W T F S
 123456
78910111213
1415 16 17181920
21222324252627
282930    

Tags

    Recent Comments

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)