next BASH question about arrays with case swapping
i have a small script that uses tf and an array that is supposed to change the case of files, it prints out on the screen, but does not mv the file name from lowercase to uppercase as i desire. I have tried putting the mv command in the script, but i broke things.
Code:
#!/bin/bash Code:
[103236_rx30@rx30 ~]$ ls -la DEA* Thanks for pointers. |
Your script is going about the file names in a very roundabout way (ls to a file, cat the file to a variable, then loop over the names in the variable). There is also no move command, so of course nothing is being moved
Code:
#!/bin/bash |
ahh so much faster then what I was trying to peace together. setting that up now.
good to know that I can just use the deaopts.*.orig right in the for do done loop. |
Code:
[103236_rx30@rx30 ~]$ sh -xvv DEA-MOVE |
Glad it worked out.
FYI - you don't need that function declaration and call either. It's not hurting anything, it's just not necessary. |
ok. thanks. still wrapping my head around building arrays. next step is to take a list of deaopts.XX file names, cat out a small portion of those files and use that to build an other array to move files around.
ex: find all of the files in the directory deaopts.* make an array of those files. set - `cat deaopts.XX` find ${1:3:3}.* -mtime +15 -exec mv '{}' /foo \; >/dev/null wash repeat for all deaopts.* in the directory. that can wait until tomorrow :D. |
All times are GMT -5. The time now is 06:39 PM. |