Search Results

Search: Posts Made By: Don Cragun
430
Posted By Don Cragun
In the code: for pdf in *.pdf do # Extract...
In the code:
for pdf in *.pdf
do # Extract common component from the name...
key=${pdf#*_*_*_} # Get rid of 1st 3 underscores and everything
# before them.
$pdf expands to the name of the...
430
Posted By Don Cragun
Maybe something a little faster and easier (i.e.,...
Maybe something a little faster and easier (i.e., no invocations of awk, basename, cut, find, or sort), like:
#!/bin/bash
set -xv
cd /home/cmccabe/folder || exit 1
for pdf in *.pdf
do # Extract...
430
Posted By Don Cragun
But the portions shown in green don't match. The...
But the portions shown in green don't match. The green portion in the PDF files contain two underscores and two hyphens. The green portion in the directories contain one underscore and three...
430
Posted By Don Cragun
Hi mccabe, I am completely confused by your...
Hi mccabe,
I am completely confused by your description of your code. I don't understand how most of what you have described could happen. (Or, since your code isn't working, maybe I'm not...
430
Posted By Don Cragun
And, in that trace output do you see that the if...
And, in that trace output do you see that the if test is always failing as shown in red above because fnmatch is being set to two values as shown in orange and then compared to $pdf which only...
430
Posted By Don Cragun
And what tracing output do you get when you run...
And what tracing output do you get when you run your script with set -xv enabled?
Showing results 1 to 6 of 6

 

Featured Tech Videos

All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy