I've registered here as I need urgent help. This is assignment for school and as you can see below I've completed the work. I'm simply stuck on one area.
This script takes the first parameter (which is to be the new extension) and each parameter after that is a file name (which will have its old extension turned into the new one). Mind you, this script works almost perfectly.
The test script (the one that grades my assignment) forces this line to call the script running from the "filderFilesAreIn" directory:
My script does the first 3 files flawlessly. The 4th file, though, my code produces this output:
It's strange as even though 'file3.dat' already exists, it replaces it with no error like above. The directory path before 'file4.dat' seem to cause the "mv -f" command to act differently.
In my code, I've used "mv -f" which is supposed to force the command to overwrite the file. This error isn't causing the program to not work but the test script (the one that grades the assignment for pass/fail) isn't letting me pass as this output is "unexpected" by it. This message is causing the script to think my code doesn't work because of the extra output.
Any help would be appreciated! I can't seem to find a way to cause "mv" to not produce any output. If I could silence the output or use another command to replace the file without getting any extra output it should count.
Thanks for your help! It's very frustrating and the teacher is being no help.
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.
Please review the rules, which you agreed to when you registered, if you have not already done so.
More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.
Hi all, I am trying to run a cronjob to push my files to my git repo once a week and output a prompt to a logfile, my script works fine if I invoke it manually but my cronjob wont run for some reason, I have sourced the file, and restarted my Mac to no avail, right now I believe I have the cronjob... (8 Replies)
Hi,
I'm having some trouble with using "case...esac" in Bash.
I've googled it and am stuggling to understand the syntax and how to do certain things.
Firstly, I want to be able to choose a case based on a variable number
For example, I have in my code a place where a user can enter... (2 Replies)
Writing a bash script for use with Geektool, pulls the battery info, and shuffles images around so that an Image geeklet can display the correct expression as the desktop background. (Eventually I intend to make it more intricate, based on more variables, and add more expressions)
I'm extremely... (1 Reply)
Hi,
I have a script that should login to a different box then the box that i am in and run the commands.
I have the script sample below that logins to a unix box and get the files .Looks like ls-lrt command is not running or its wrongly used.
#!/bin/bash
# Ask the user for build month... (5 Replies)
Hi, i want to rename a group of directories and files of my music, some items are like this:
- , for directories.
- , for files.
I want to do something like this:
, for directories.
, for files.
This is my code:
#!/bin/bash
for fname in *.mp3; do
echo item: $fname
mv... (2 Replies)
So what i am trying to do is write a script that takes in any number of scrambeled words and unscrambles them.
I have already addressed the issues of partial matches, exits silently if there are no matches, and finds words regardless of case that they were input. but while trying to get it so... (3 Replies)
Hi.
The below part of my bash script kicks out the following error message:
$ ./extract_eod_report_stats_new.sh 2010-04-23
./extract_eod_report_stats_new.sh: line 204: syntax error near unexpected token `('
./extract_eod_report_stats_new.sh: line 204: `TRANSACTIONS_RECEIVED_TOP=`grep... (6 Replies)
Hello there
Been using Unix bash scripting for two days now so am very new to this. I am currently doing a project now and i'm basically making a noughts and crosses game (or tic tac toe).
I have created the board using an array. When I try and check to see if the array is empty using an If... (3 Replies)
Hello
I need assistance with a bash script that needs to tell me whether in the last "x" days (which is a variable) anyone connected to the xxxx IP (which is another variable).
Thank you! (1 Reply)
Hi,
I have written the following UNIX for HP-UX 11i. The script basically checks for files older then 45mins in 2 repective directories and then sends and email to the administrator about them.
Problem with the script is that I can run it from the command line and crontabtab but 80% of the... (2 Replies)