I have a text file WIDeletion2.txt
whose sample text is as follows.
$ head WIDeletion2.txt
5A1E7DF7C1C8BC4497FE3AD68954EF21 VA_ITSHOME
294A07B8ABDC454FABD0CD488B3FA51B VA_ITSHOME
C15A689952E4A14993B4787020258AEA VA_ITSHOME
C3E8CFE6FFBD3A45B37336D270940AC8 VA_ITSHOME
F69955919630784EB41FE8D0BE2A260F VA_ITSHOME
DD044FFD70FDED46AEA9205DA3435B24 VA_ITSHOME
0C678B5BC6531140BE92F40A0B727012 VA_ITSHOME
It contains around 90k of lines like this. I want to add deletedwob
at starting of each line and " y y"
(without quotes) at the end of each line.
I am trying to achieve this doing the following (on AIX):
$ for i in `cat WIDeletion2.txt`
> do
> echo deletewob $i y y >> WIDeletion3.txt
> done
ksh: no space
I am getting a ksh: no space
error. I have verified the space of /tmp
as well. There is around 600mb of space available and the size of WIDeletion2.txt
is as below.
$ ls -ltr WI*
-rw-rw-r-- 1 fnsw fnusr 3390146 Apr 10 10:50 WIDeletion2.txt
df
for mount /tmp
is:
$ df -m /tmp
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd3 1024.00 615.37 40% 1601 2% /tmp
So by adding those extra stuffs to file it can go to twice or thrice of its size which would be at max 20 mb and I have 600 mb space available. I even tried putting it in a script and then running the script which yields the same error. Any ideas why I am getting this error?
Your shell is running out of memory processing that loop. Try:
sed -e 's,^,deletedwob ,' -e 's,$, y y,' WIDeletion2.txt > WIDeletion3.txt
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments