![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help on move (mv) command | jambesh | Shell Programming and Scripting | 2 | 04-26-2008 11:23 AM |
| move command | thepurple | SUN Solaris | 3 | 10-06-2007 07:26 AM |
| How to test whether a move command has been well executed | Lutchumaya | Shell Programming and Scripting | 6 | 01-25-2007 02:56 AM |
| Move command in the shell isnt executing... | thumsup9 | Shell Programming and Scripting | 2 | 02-01-2005 09:50 PM |
| Help on MOVE command | michelr | UNIX for Dummies Questions & Answers | 2 | 03-13-2001 11:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Move command problem
In my shell script I am searching a log file, creating a directory and have to move the searched logfile into the directory.This is the way I wrote:
ZIP_LOG_FILE=`find . -name "${LOG_FILE}" -print0| xargs -0 tar zcf FILE` mkdir temp_log mv -f ${ZIP_LOG_FILE} temp .... this is a piece of the script....and I get this error: mv: missing destination file operand after `templog' Try `mv --help' for more information. What could be wrong??...... |
|
||||
|
to answer your question about mv- your first param which is a variable is probably empty, resulting in a mv expression with only one parameter. Thats why its complaining.
I'd write it in another way, try this: Code:
saved_ifs=$IFS; IFS=' ' for $file in $(find $search_here -type f -name "$LOGFILE" ) ; do mkdir -p $savedir mv -f "$file" $savedir done IFS=$saved_ifs cheers |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|