Sponsored Content
Full Discussion: move script
Top Forums Shell Programming and Scripting move script Post 302720307 by mhs on Tuesday 23rd of October 2012 06:12:19 PM
Old 10-23-2012
move script

hi guys i have a simple question

i have a directory with name of files in /tmp which contain some files

i want to check all files with file command and if they were MP3 or Wave sync them into new place . for example ( /root/mp3 )
i find all files and remove white space and rename them
next i check them with file command and if they were mp3 or wave we should sync or copy them with exact path into new place

eg.

/tmp/files/test1 ------> /root/mp3/test1

/tmp/files/New/test2 ----------> /root/mp3/New/test2

/tmp/files/New/last/Old/test-old ------------> /root/mp3/New/last/Old/test-old

files should copy into same directory in new the place

what can i do ?

i think to
echo $new |sed "s#/tmp/files#/root/mp3"
but it doesnt work Smilie

what can i do ??
PHP Code:
#!/bin/bash
old=/tmp/files
new=/root/mp3
find 
/tmp/files3 -name *.* | while read FILE
do
new=$(echo 
$FILE sed 's/ /_/g')
mv "$FILE$new
file 
"$new|egrep -'MP3|WAVE'
if [ $? = ]
then
cp 
.................
fi
done 
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Copy Move Script

Hello Gurus! Please help! I would like to get some help with the following: I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies

2. Shell Programming and Scripting

script to move logs

Does anyone have a good script to move log files from a cron? There are a lot of logs, about 100 or more and they are constantly being written too. (7 Replies)
Discussion started by: photon
7 Replies

3. Shell Programming and Scripting

script to move

Hi, Want to write a script which move like: these are files in different dir structure, /home/darshak/test/sh/new.txt /home/darshak/test/new1.txt /home/darshak/test/pl/file.txt script will move same structure as above but in different dir, /usr/local/test/sh/new.txt... (2 Replies)
Discussion started by: darshakraut
2 Replies

4. UNIX for Dummies Questions & Answers

Move Script

Hi I am very new to scripts and only have a basic knowledge What i am trying to do is move files from one directory to another, but i need to make sure the file is stable before it moves the file to the destination. Here is the script that i am using that is moving the files, it part of a script... (8 Replies)
Discussion started by: treds
8 Replies

5. UNIX for Dummies Questions & Answers

Move command within script

Anyone have an idea to why the statement below does not work within a script but works when issued from the command line? mv /dir_files/submit.log* /bintemp (1 Reply)
Discussion started by: bwcberb
1 Replies

6. UNIX Desktop Questions & Answers

Help with Script to Move Directories

Hi I am after a simple script to move folders/files from one directory into another directory on the same server. I want to run a cron so this can run at midnight. Issue is there will not always be data in the source folder. This script works fine but it errors if nothing exists in the source... (3 Replies)
Discussion started by: treds
3 Replies

7. Shell Programming and Scripting

Script move files by name

hi, I have a lot of files named xxxxx__AA.txt, xxxxx__BB.txt, xxxxx__CC.txt and I would like to move xxxxx__AA.txt in AA directory, xxxxx__BB.txt in BB etc. Could you help me do it in bash script? (5 Replies)
Discussion started by: corfuitl
5 Replies

8. Shell Programming and Scripting

Script to move certain no. of files every second

Hi All, I am new to Linux/Scripting and need some assistance in coming up with a script that can move certain amount of files from one directory to other every seconds. Usercase: We have around 100k files in tmp directory on my server which needs to be moved to another folder to get... (3 Replies)
Discussion started by: Raj1184
3 Replies
dr_symlinks(1)							  USER COMMANDS 						    dr_symlinks(1)

  NAME
      dr_unsort - unsort the current mpd playlist

  SYNOPSIS
      dr_unsort

  DESCRIPTION
      dr_unsort invokes unsort(1) on the current audio playlist as used by mpd.  Use it if you'd like some variation in your music.

  EXAMPLE
      If The_Beatles/The_White_Album_I/03-Glass_Onion.ogg is the current playing track and your current playlist looks like

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

      invoking dr_unsort will yield something like e.g.

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

  WARNING
      Due to limitations in the mpc/mpd protocol, dr_unsort needs filesystem level write access to mpd's playlist directory.

  ENVIRONMENT
      dr_unsort honors strings DR_PLAYLISTS (mpd's playlist directory) and DR_UNSORT (unsort pathname).

  SEE ALSO
      unsort(1), available from http://packages.debian.org/unsort.

  COPYRIGHT AND LICENSE
      This manpage is copyright 2010, 2011 Joost van Baal <joostvb-draai@mdcc.cx>.

      Draai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free
      Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed	WITHOUT  ANY  WAR-
      RANTY. You should have received a copy of the GNU General Public License along with draai. If not, see http://www.gnu.org/licenses/.

  AUTHOR
      Joost van Baal <joostvb-draai@mdcc.cx>

  dr_symlinks 20110603						     03 juin 2011						      dr_symlinks(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy