Run the command:
The output should be something like:
Save the value marked in blue italics.
Create a file named something like get_pdf containing the following Korn shell script:
and replace the string marked in red in this script with the string you saved from the output of the type command.
Then run the commands:
You should then be able to run the command get_pdf no matter what directory you are in and it will display the commands it would use to rename and move PDF files from the directory /media/PDF to the directory /media/new_PDF.
If the commands displayed are the commands that you want this script to perform, change the line in $HOME/bin/get_pdf that currently says:
to:
Change the ../new_PDF in that line to any other directory if you want to change the directory to which the renamed files should be moved.
If you already have a script that you run after you have edited a PDF file to attach it "back to the MS Access record", I would suggest adding a call to get_pdf to the end of that script rather than trying to run it through cron. It won't consume as many resources in the background while you're doing other work and it will look for more PDF files to move as soon as you're ready to work on one. (Of course, if you do it this way and you get ahead of the "front-of-house staff", you'll have to run get_pdf manually until they catch up to you.)
Last edited by Don Cragun; 01-19-2013 at 11:22 PM..
Reason: quote out of place
This User Gave Thanks to Don Cragun For This Post:
How do I write the command to find all files with any lower case letters in the filename? I have tried
find . -name *\(a-z\) and a lot of combinations like that, without success.
thanks
JP:confused: (4 Replies)
Hi,
I need to write a small script to search in some specific directories to check if any file is present with a unix command name...
Means if the directory contains any files like cat, vi, grep, find etc i need to list those files into a file.
Please help
Thanks,
D (6 Replies)
Hi,
I am having set of files whose names are stored in a file say "filelist.txt"
Now, I want to find all files contained in "filelist.txt" from my parent directory.
Is there any way to let find command understand "filelist.txt" just like we have option -f in awk.
I donot want to run a... (4 Replies)
Hi, guys, I'm not a high-end programmer, but I've been trying to write a script to remove all of the b.rtbn2.cn (and b.adserv.cn and any future variation) injected script tags on the server. (Still working on security fixes to prevent it in the future, just need to clean up now.)
My approach is... (1 Reply)
Hi Gurus,
Do any kind souls encounter have the same script as mentioned here.
Find and compare filenames in different mount point and remove duplicates.
Thanks a million!!!
wanna13e (7 Replies)
I have the following code:
find /usr/local/test5 -type f -mtime +30 -exec ls -l {} \; | awk '{print $5, $6, $7, $8, $9}'
I have this as output:
14 Aug 12 00:00 /usr/local/test5/file1
14 Aug 12 00:00 /usr/local/test5/lastname,
The bolded part is where I run into trouble. The actual... (4 Replies)
I have input file called file1 with characters that have \\ in it.
I cannot change input file, because it is generated earlier in script.
Now would like to replace string on line in file called bfile with output from file1
I have been using sed command.
$cat file1
pc//6sPxp==
$ cat scr1... (4 Replies)
I have a group of files in different directories with characters such as " ? : in the file names. How do I find these files and remove these characters on mass?
Thanks (19 Replies)
Hi,
Can anyone let me know the command to know the list of filenames that have string 31 in their 4th and 5th positions inside the file:
grep -l "31" main*.txt
The above grep lists all the files which have 31 at any position but I want filenames having 31 at position 4 and position 5. (8 Replies)
Hi,
How to change the filenames with timestamp in sub folders
I have the following code to select the records.
find . -type f -name '*pqr*' -ctime 1 -print
The following is the example
app_root_dir="/`echo $ScriptDir | cut -d'/' -f2`"
$app_root_dir/../BadFiles directory
uvw.bad... (3 Replies)