Search Results

Search: Posts Made By: aealexanderraj
6,874
Posted By Lem
Which shell? Which OS? If the prefix...
Which shell? Which OS?



If the prefix will always end with "_", and if there are no "_" but in the prefix, it's trivial.

Something like:
$ prefix="$(ls |grep -o '.*_' |head -n1)
$ [ -f...
6,874
Posted By Subbeh
Or take the first 24 characters of the filename: ...
Or take the first 24 characters of the filename:

prefix=$(ls|head -1| sed 's/^\(.\{24\}\).*/\1/')
for file in acc faf prom subs ; do
[ -e ${prefix}${file}.csv ] || touch...
6,874
Posted By bomberman
awk can have a string delimiter supplied and...
awk can have a string delimiter supplied and parse the first part as a separate string. Use that for determining your file names.

ls -1 *acc.csv | awk -F"acc.csv$" '{print $1}'

You also have...
Showing results 1 to 3 of 3

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