Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Programming & Scripting
Reload this Page script for zipping files
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Programming & Scripting C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Reply
 
Thread Tools Display Modes
Old 05-22-2008   #11 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,027
On a first sight, that script is syntactically correct, so it should work. Look out for bad line breaks if you wrote this on the windows notepad or something like that (tip: dos2unix).

Also, for the sake of consistency, if you use $() on the DATE line, you should use the same on the BASE line instead of `...`. Uniformity helps readability of the script quite a bit, and $() is always preferable on a script because it's meaning is inmediatly obvious, while the clarity of backticks ` often depends on teh font you are using :P

Other than the styliscit note I don't see any problem with that script.
i92guboj is offline   Reply With Quote
Old 05-22-2008   #12 (permalink)
vsemaska
Linux Newbie
 
Join Date: Jun 2007
Posts: 209
Change the 1st line to (add the -vx):

Code:
#!/bin/bash -vx
This will display the commands as they're being executed. I copied your script and ran it, it worked for me.
vsemaska is offline   Reply With Quote
Old 06-26-2008   #13 (permalink)
DanglingChap
Just Joined!
 
Join Date: Mar 2007
Posts: 21
sorry guys - i was not able to get back to this thread and was not able to reply/thank to the help you gave me.

I tried to change the script as per you people said .. but again same error

Code:
[root@server logs]# sh zipping-script.sh 
: command not foundline 2: 
zipping-script.sh: line 9: syntax error near unexpected token `done'
zipping-script.sh: line 9: `    done'
DanglingChap is offline   Reply With Quote
Old 06-26-2008   #14 (permalink)
vsemaska
Linux Newbie
 
Join Date: Jun 2007
Posts: 209
As i mentioned in my last post we need to see the commands being executed. I suggested this as your 1st line in the script:

Code:
#!/bin/bash -vx
Another way is to run the script with this command:

Code:
sh -vx zipping-script.sh
vsemaska is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 05:23 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0