Official Introduction from neo1691 - Community & Forums Related Discussions

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
Well, in order to learn more about linux, you _HAVE_ to learn shell scripting. It's not that hard. A script is a file containing a set of commands.

Let's say you notice that you do the following a lot:
Code:
~$ ls
Desktop Pictures Videos
~$ cd Videos
~/Videos $ ls
MLP-season-1/ Youtube-DL/ 2girls1cup.avi goatse.avi
~/Videos $ mplayer goatse.mp4
You can simplify the process of entering a directory and choosing a video by scripting it

Code:
#!/bin/sh
#
# z3bra (c) wtfpl
# Select a video to watch from a specified directory
VIDEO_DIR="$HOME/Videos"

cd $VIDEO_DIR
select VIDEO in ls *.avi
do
    mplayer $VIDEO &
done
exit 0

And there you are. This is a script !
Start it, and it will prompt you for all the .avi files in your ~/Videos, ask you for the file you want and play it via mplayer.


Messages In This Thread
Official Introduction from neo1691 - by neo1691 - 25-08-2014, 06:31 AM
RE: Official Introduction from neo1691 - by z3bra - 25-08-2014, 06:45 AM
RE: Official Introduction from neo1691 - by z3bra - 25-08-2014, 08:28 AM
RE: Official Introduction from neo1691 - by xero - 26-08-2014, 12:58 AM