Search Results

Search: Posts Made By: jhsinger
5,324
Posted By Don Cragun
Yes, you're close. To work on files with names...
Yes, you're close. To work on files with names ending in .vtk in the current directory and its subdirectories, try:
find . -name '*.vtk' |
while read file
do
printf "Do whatever you want...
1,564
Posted By bakunin
Great! You are in for learning the most...
Great! You are in for learning the most interesting thing there is the world: shell programming in the Unix environment!

(Well, now that i jog my memory really hard, i have to admit there are a...
1,564
Posted By Yoda
This solution is based on some assumptions (using...
This solution is based on some assumptions (using parameter substitution):
#!/bin/bash

for file in *.vtk
do
x="${file%%_*}"
x="${x//[a-z]}"

y="${file#*_}"
...
1,564
Posted By Don Cragun
Assuming that you're using a POSIX conforming...
Assuming that you're using a POSIX conforming shell (such as ksh or bash), the following seems to do what you want:
#!/bin/ksh
for file in x*_y*_z*.vtk
do
printf "%s\n" "$file" | (
...
Showing results 1 to 4 of 4

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