Music Organizer Script. Don't know where to begin.
I'm having problems with this assignment. I know how to do these basic unix "if" and "then" statements) What I am having trouble with is putting my script together. I started with #!/bin/bash and not sure how to continue. I have to indicate the source and destination folders, and make each a parameter, which I dont know how to do. So could please someone guide me on how to get this script started the right way?
1. The problem statement, all variables and given/known data:
3. The attempts at a solution (include all code and scripts):
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Seneca @ York, Toronto, Ontario, Canada, Mark Buchner, ULI101C
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Last edited by methyl; 04-06-2012 at 12:58 PM..
Reason: insert code tags for readability
# PLEASE NOTE THAT PLAGIARISM CASES WILL BE HANDLED ACCORDING TO THE ACADEMIC
# POLICY. YOUR SCRIPT MUST BE WRITTEN WITHOUT HELP FROM OTHERS AND YOU ARE NOT
# ALLOWED TO ACCESS OTHER STUDENTS' ASSIGNMENTS
# DO NOT SHARE YOUR SOLUTION. ASK ONLY YOUR PROFESSOR FOR HELP.
You need to edit the supplied script and substitute suitable unix commands wherever the the lecturer has placed a comment line "### TO DO".
For the above command, after editing it might read something like:
The sample script is correctly structured. You don't need to change the order of the commands - just find the appropriate command each time the lecturer has given a sample line or asked you to insert a line which you have written from scratch.
Big Hint: Comment out the lecturer's incomplete sample lines until you can edit the script to produce valid syntax. This will enable you to build the script line-by-line with valid syntax and debug from the top down.
Another hint: Use echo or printf statements to check the value of variables while you are testing the script.
Quote:
# The script usage will be as follows:
# momo source_directory [destination directory]
In your sample code, the source and destination directories have been set to hard values rather than from parameters supplied when the script was invoked ($1 and optionally $2). This is not correct. There is a lot of useful information in the comments in the lecturer's script.
Good luck.
Last edited by methyl; 04-06-2012 at 01:34 PM..
Reason: grammar, typos
Hi Guys,
I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Hey guys, not sure I am in the right forum for this, just trying a shot in the dark here. I am using an app on my android to control certain functions on my pc's music player but need to have the app perform 2 specific tasks within my music player so I am looking around for a coder or programmer... (2 Replies)
Can Someone please explain why BEGIN and END statement is used inside function? How does that help in scripting?
function fileformatting
{
CleanupMask="xXxX"
sed 's/^.//' < ${AllFile} > ${AllFile}.tmp
echo $(wc -l ${AllFile}.tmp)
`awk -v CleanupMask=${CleanupMask} '
BEGIN... (2 Replies)
pointsb=`awk -v a2="$a2" -v b2="$b2" -v c2="$c2" -v yb="$yb" -v yc="$yc" \
'BEGIN { for (y=yc; y<=yb; y++) { x = a2*y*y+b2*y+c2; print x, y }; }'`
I am learning shell script. I was reading a script and got confused in this line.
I understood that awk is allowing to assign the variable.
But... (10 Replies)
I have a file that stores data in pairs of lines, following this format:
line 1: header (preceded by ">")
line 2: sequence
Example.txt:
>seq1 name
GATTGATGTTTGAGTTTTGGTTTTT
>seq2 name
TTTTCTTC
I want to filter out the sequences and corresponding headers for all sequences that are less... (2 Replies)
Hi,
I have a file:
file.txt
1 word
2 word
word
word
3 word
4 word
and I would like to create a set:
set number = `cut -d" " -f1 ${1}` #${1} is the text file
but it should only contain the lines which begin with numbers,
and another set which contains the lines which begin with... (10 Replies)
Hello sir,
I want to monitor my work on the terminal.I know we can use script command.But every time when I start the terminal, I have to type script to start it.I want to automate it. So where should I include this command so that it will start as soon as I start the terminal ???? (2 Replies)