Search Results

Search: Posts Made By: jimjam
2,379
Posted By bakunin
There are also two commands, "dirname" and...
There are also two commands, "dirname" and "basename", you might want to know about. Both are fed a pathname, "pathname" chops off everything up to the last "/" (thus leaving the filename without a...
2,379
Posted By Scott
$ pwd /home/work $ echo ${PWD##*/} work
$ pwd
/home/work
$ echo ${PWD##*/}
work
3,813
Posted By Corona688
I'm not quite sure what you're even trying to do...
I'm not quite sure what you're even trying to do there.

The xargs utility converts streams into arguments, precisely what this problem needs. It can run awk once with many files(leave off the -n...
3,813
Posted By Scrutinizer
Quick solution, you could try: ls a_*.out |...
Quick solution, you could try:
ls a_*.out | sort -t_ -k2n |
while read f
do
cat "$f"
done |
awk '{arr[$1]=arr[$1] " " $2}END{for(i in arr)print i,arr[i]}'

--
Looking at your awk script,...
3,813
Posted By Scrutinizer
Or a bit shorter: ls a_*.out | sort -t_ -k2n | ...
Or a bit shorter:
ls a_*.out | sort -t_ -k2n |
while read f
do
awk... "$f"
done
3,813
Posted By elixir_sinari
ls a_*.out > file_list awk -F"[_.]" '{print $2"...
ls a_*.out > file_list
awk -F"[_.]" '{print $2" "$0}' file_list|sort -n|awk '{print $2}' > temp
mv temp > file_list
while read f
do
awk <your-program> "$f"
done < file_list
Showing results 1 to 6 of 6

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