Search Results

Search: Posts Made By: joeyg
11,939
Posted By joeyg
(to ripat) you are correct
My earlier solution would only work with the example file structure. SO, how about the following:

> cat another_shift
A=/bb/data/f233pdb
fldb=$(echo $A | tr "/" "\n" | wc -l)
flda=$((fldb-1))...
11,939
Posted By joeyg
Another approach
> A=/bb/data/f233pdb
> B=$(echo "$A" | cut -d"/" -f4)
> C=$(echo "$A" | cut -d"/" -f1-3)"/"

> echo $A
/bb/data/f233pdb
> echo $B
f233pdb
> echo $C
/bb/data/
Showing results 1 to 2 of 2

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