|
Home > Archive > Unix questions > November 2006 > long filename and sed
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
long filename and sed
|
|
| manish 2006-11-08, 1:25 am |
| Hi All,
I used sed to insert text ( " ,0" in my case ) to the end of every line
in a file.
I used the following :
sed -e 's/$/ ,0/' abc.txt > new_abc.txt
This is working fine with the file name as given above..But doesn't
work when i use the file name
systemconfiguration_spatial.MSFANNOUNCEMENT.bulk >
new_ssystemconfiguration_spatial.MSFANNOUNCEMENT.bulk
then it is not working.
Where may be the problem ?
Thanks,
Manish.
| |
| John Gordon 2006-11-13, 9:01 am |
| In <1162958108.411283.281800@m7g2000cwm.googlegroups.com> "manish" <manishmodgil@gmail.com> writes:
> systemconfiguration_spatial.MSFANNOUNCEMENT.bulk >
> new_ssystemconfiguration_spatial.MSFANNOUNCEMENT.bulk
> then it is not working.
> Where may be the problem ?
Well, for starters, I don't see a sed command there, just two filenames.
When you say "it doesn't work", what exactly do you mean? Do you get an
error message?
--
John Gordon "... What with you being his parents and all,
gordon@panix.com I think that you could be trusted not to shaft
him." -- Robert Chang, rec.games.board
| |
| manish 2006-11-13, 9:01 am |
|
John Gordon wrote:
> In <1162958108.411283.281800@m7g2000cwm.googlegroups.com> "manish" <manishmodgil@gmail.com> writes:
>
>
>
>
> Well, for starters, I don't see a sed command there, just two filenames.
Well .. i didn't write the command part again .. what i meant was that
when i replace the filenames in the original command with these
filenames then i face the problem.
>
> When you say "it doesn't work", what exactly do you mean? Do you get an
> error message?
>
Although the command shows nothing on the terminal.. and there is no
change in the file...too......
> --
> John Gordon "... What with you being his parents and all,
> gordon@panix.com I think that you could be trusted not to shaft
> him." -- Robert Chang, rec.games.board
| |
| Moe Trin 2006-11-13, 9:01 am |
| On 8 Nov 2006, in the Usenet newsgroup comp.unix.questions, in article
<1163048251.050006.104550@f16g2000cwb.googlegroups.com>, manish wrote:
>John Gordon wrote:
>Well .. i didn't write the command part again .. what i meant was that
>when i replace the filenames in the original command with these
>filenames then i face the problem.
>
>
>Although the command shows nothing on the terminal.. and there is no
>change in the file...too......
In your original post your said:
] sed -e 's/$/ ,0/' abc.txt > new_abc.txt
works, but when you use the long file names it doesn't. Your headers show
some form of windoze - what operating system are you using, and what shell?
The two long filenames (and the intervening space and redirect) are 105
characters, 123 if you add the command itself. Could you be getting caught
in a line-wrap or line-length situation thanks to some "user friendly" shell
setting?
Old guy
| |
| manish 2006-11-13, 9:01 am |
|
Moe Trin wrote:
> On 8 Nov 2006, in the Usenet newsgroup comp.unix.questions, in article
> <1163048251.050006.104550@f16g2000cwb.googlegroups.com>, manish wrote:
>
>
>
> In your original post your said:
>
> ] sed -e 's/$/ ,0/' abc.txt > new_abc.txt
>
> works, but when you use the long file names it doesn't. Your headers show
> some form of windoze - what operating system are you using, and what shell?
> The two long filenames (and the intervening space and redirect) are 105
> characters, 123 if you add the command itself. Could you be getting caught
> in a line-wrap or line-length situation thanks to some "user friendly" shell
> setting?
Hi i am using Solaris 10 systems, BASH shell.
>
> Old guy
| |
| manish 2006-11-15, 1:30 am |
|
manish wrote:[vbcol=seagreen]
> Moe Trin wrote:
>
> Hi i am using Solaris 10 systems, BASH shell.
>
Thanks to all ...
I got the solution ..
Actually what was happening was that while using the long file name i
used the same filename on both sides of the redirection operator .. I
am sure changing that to something else and then moving the new file to
the original filename would solve the problem.
Regards,
Manish.
|
|
|
|
|