Search Results

Search: Posts Made By: AlokKumbhare
30,380
Posted By MadeInGermany
Aren't 350 000 files too many arguments for for i...
Aren't 350 000 files too many arguments for for i in *?
Safer and faster is

find . -type f |
while read i
30,380
Posted By Scrutinizer
Try something like: cd XYZ || { echo "directory...
Try something like:
cd XYZ || { echo "directory does not exist" > &2; exit 1 ;}
n=0
for i in *
do
if [ $((n+=1)) -gt 10 ]; then
n=1
fi
todir=../XYZ$n
[ -d "$todir" ] || mkdir...
1,315
Posted By Don Cragun
If preserving the order of lines in File 1 is...
If preserving the order of lines in File 1 is important, this comes close to producing the output you requested:
awk '
BEGIN { # Set input and output field separators
FS = OFS = ":"
}
NR == 1 {...
1,315
Posted By Scrutinizer
Try something like this: awk 'NR==FNR{A[$1]=$2;...
Try something like this:
awk 'NR==FNR{A[$1]=$2; next} FNR in A{print $1, A[FNR]}' FS=": *" file1 FS=" " OFS=: file2 > newfile
If succesful replace file1 with newfile.

Output:
xyz1:Banana...
Showing results 1 to 4 of 4

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