I am trying to write a linux shell script that will take every file in a folder
/home/user/desktop/fileme
and place it in a folder with the same name as the folder
before
/home/user/desktop/fileme/stuff.txt
/home/user/desktop/fileme/other.avi
/home/user/desktop/fileme/last.jpg
after
/home/user/desktop/fileme/stuff/stuff.txt
/home/user/desktop/fileme/other/other.avi
/home/user/desktop/fileme/last/last.jpg
This seems to be the closest I have gotten
Ultimatly id also id like to keep the file extenuation in the folder name striping out the . before the file extention and replacing it with a # or some other special character but really any help would be appreciated
before
/home/user/desktop/fileme/stuff.txt
/home/user/desktop/fileme/other.avi
/home/user/desktop/fileme/last.jpg
after
/home/user/desktop/fileme/stuff#txt/stuff.txt
/home/user/desktop/fileme/other#avi/other.avi
/home/user/desktop/fileme/last#jpg/last.jpg
Any help with code or pointing me in the right directions would be greatly appreciated.
You can ignore my partial solution if you have a better one
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Hello *nix friends,
I've written a shell script that allow web admin's to copy file/folder from a development site to the production site. It's more or less a poor man SVN.
I'm posting the script here because I was able to get many questions answered through this forum and also, I want to... (4 Replies)
Hello,
I'm trying to make a bash script that send me e-mail if there is any new file in my ftp folder.
cat inotify.sh
#!/bin/sh
/usr/bin/inotifywait -e create \
-mrq /home/mrowcp | while read line; do
echo -n "$line " >> /var/log/inotify.log
echo `date | cut -d " " -f1-4` >>... (3 Replies)
Hi everyone I am new to the forums.
I haven't done much linux myself but I have been asked if I can do the following.
Write a linux script that needs to scan a certain folder every x amount of minutes and if there is a file in the folder then it needs to call a different script.
Is this... (2 Replies)
Hi there,
i have a question.
I have a folder called /usr/test
There is a file in it.... test.csv
I need not a shell script that checks if there is a file called: test.del
And if the file is in the same folder then the script should delete the test.csv and also the test.del.
Hope... (9 Replies)
This is the file structure:
DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg
DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg
DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg
DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg
DESKTOP/Root of Photo... (4 Replies)
Hi ,
I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name
for ex
file a should be moved to y folder and renamed as a_20081015 (1 Reply)
Hi all,
I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt.
I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Hi,
I have two folders in two different directories.Both the folders contain set of text files. The name of the files are same in both the folders. I need to write a script to compare all the files in both the folders having same name. I am new to unix. Can you help me out in giving a script to... (4 Replies)
Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)