Search Results

Search: Posts Made By: jimjam
2,827
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,827
Posted By Scott
$ pwd /home/work $ echo ${PWD##*/} work
$ pwd
/home/work
$ echo ${PWD##*/}
work
4,026
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...
4,026
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,...
4,026
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
4,026
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 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy