Sponsored Content
Top Forums Shell Programming and Scripting my shell now adds extra space at end of each line! Post 302717773 by trogne on Thursday 18th of October 2012 03:51:02 PM
Old 10-18-2012
my shell now adds extra space at end of each line!

Hi,

Since today, with csh or tcsh, if I do 'ls files* > list',
every lines end with an extra space!

What happenned?

What can I do to go back when there was no extra space?

If I change to bash, there's no extra space.


Thanks,

Patrick

---------- Post updated at 03:19 PM ---------- Previous update was at 02:17 PM ----------

One more thing that was working before :

$req = this string :
035="(OCoLC)742516066" OR 035="(OCoLC)742516257" OR 035="(OCoLC)785779093" OR 035="(OCoLC)708602160" OR 035="(OCoLC)742516066"

If I execute a script with $req as a paramater :
csh -f $aleph_proc/p_ret_03 UDQ01,exportfile,$req,

$req becomes only '035=@@034@@040OCoLC@@041742516066@@034'


**So it is cut after the first space.**

So a big problem with space!!!

What's wrong?

---------- Post updated at 03:51 PM ---------- Previous update was at 03:19 PM ----------

I fixed the $req problem with this quotes : "${req}"
As if the space was OK inside quotes.

But my main concern is the extra space at the end of each line, wtih 'ls files* > list'.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to see space, tab, end of the line chracters

what can I use ?? In vi, I can use :set list <-- and see end of line $.. or use cat -A but I am wondering if there is command or program that allows me to see all the hidden characters( space, tab and etc) Please help thanks. (3 Replies)
Discussion started by: convenientstore
3 Replies

2. UNIX for Advanced & Expert Users

how can I read the space in the end of line

cat file1|while read i do echo "$i"|wc done with this command the space in the end of the line not considered how can solve that for example: read h "hgyr " echo "$h"|wc 4 (2 Replies)
Discussion started by: Ehab
2 Replies

3. Shell Programming and Scripting

Add white space to the end of a line with sed

Im trying to add 5 blank spaces to the end of each line in a file in a sed script. I can figure out who o put the spaces pretty much anywhere else but at the end. thanks Karl (7 Replies)
Discussion started by: karlanderson
7 Replies

4. Shell Programming and Scripting

sed : replace space and end-of-line

Hi ! I'm rather new with sed ... learned a lot already by googling etc ... The following script should replace all spaces and ends-of-lines with "something (see below). #!/bin/bash i=0 while read line do fam="H`printf "%06d" $i`" echo $line | sed -e 's//\t'$fam'\n/g' i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies

5. Shell Programming and Scripting

Replace end of line with a space

for eg: i have i/p file as: ================ i wnt to change end of line ================= my require ouput is like: i wnt to change end of line ==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies

6. Shell Programming and Scripting

NULL in between, at begining or at end of line - convert to space

How to replace null with space? I want to make each line with 80 characters. If any line contains only 5 characters and remaining is null, then i want to make it as 80 characrets where 5 is original characters and remaining 75 characters will be null.. NULL can come in between the line,... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies

7. Shell Programming and Scripting

m4 adds extra space at top of file.

I have used m4 in the past to generate source code where aesthetics and space were of no consequence . Now I am using it to generate script and program templates . So here is an excerpt from my m4 file for producing a generic bash script: dnl `$Id$' define(`START_SCRIPT',`#!/bin/bash... (8 Replies)
Discussion started by: Bubnoff
8 Replies

8. Shell Programming and Scripting

Remove line starting from space till end.

Hi, I have a code tag, from which i have the below snippet: intelrpt.GetCMB_FB type=ODBC> intelrpt.GetCMB_FB type=SYBASE> I want the output like: intelrpt.GetCMB_FB intelrpt.GetCMB_FB That is remove the lines starting from WHITESPACE till end. Please help. I am new to... (7 Replies)
Discussion started by: anupdas
7 Replies

9. Shell Programming and Scripting

How to Add space at the end of each line in linux

hi,. I am writing a small script in csh... Can any one tel me how to add space at end of each line in a file (9 Replies)
Discussion started by: Manju87
9 Replies

10. UNIX Desktop Questions & Answers

To remove the extra spaces at the end of each line in a file

I have a file of about 10k records and eace line is having an extra space of 5 byte at the end.. Iwant to remove the extra spaces at the end of each line.. Can someone please help me out.. I tried using sed command and its not working... can someone please help me out. (3 Replies)
Discussion started by: rammohan
3 Replies
RTNETLINK(3)						     Linux Programmer's Manual						      RTNETLINK(3)

NAME
rtnetlink - macros to manipulate rtnetlink messages SYNOPSIS
#include <asm/types.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <sys/socket.h> rtnetlink_socket = socket(AF_NETLINK, int socket_type, NETLINK_ROUTE); int RTA_OK(struct rtattr *rta, int rtabuflen); void *RTA_DATA(struct rtattr *rta); unsigned int RTA_PAYLOAD(struct rtattr *rta); struct rtattr *RTA_NEXT(struct rtattr *rta, unsigned int rtabuflen); unsigned int RTA_LENGTH(unsigned int length); unsigned int RTA_SPACE(unsigned int length); DESCRIPTION
All rtnetlink(7) messages consist of a netlink(7) message header and appended attributes. The attributes should be only manipulated using the macros provided here. RTA_OK(rta, attrlen) returns true if rta points to a valid routing attribute; attrlen is the running length of the attribute buffer. When not true then you must assume there are no more attributes in the message, even if attrlen is nonzero. RTA_DATA(rta) returns a pointer to the start of this attribute's data. RTA_PAYLOAD(rta) returns the length of this attribute's data. RTA_NEXT(rta, attrlen) gets the next attribute after rta. Calling this macro will update attrlen. You should use RTA_OK to check the validity of the returned pointer. RTA_LENGTH(len) returns the length which is required for len bytes of data plus the header. RTA_SPACE(len) returns the amount of space which will be needed in a message with len bytes of data. CONFORMING TO
These macros are nonstandard Linux extensions. BUGS
This manual page is incomplete. EXAMPLE
Creating a rtnetlink message to set the MTU of a device: #include <linux/rtnetlink.h> ... struct { struct nlmsghdr nh; struct ifinfomsg if; char attrbuf[512]; } req; struct rtattr *rta; unsigned int mtu = 1000; int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); memset(&req, 0, sizeof(req)); req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); req.nh.nlmsg_flags = NLM_F_REQUEST; req.nh.nlmsg_type = RTM_NEWLINK; req.if.ifi_family = AF_UNSPEC; req.if.ifi_index = INTERFACE_INDEX; req.if.ifi_change = 0xffffffff; /* ??? */ rta = (struct rtattr *)(((char *) &req) + NLMSG_ALIGN(req.nh.nlmsg_len)); rta->rta_type = IFLA_MTU; rta->rta_len = RTA_LENGTH(sizeof(unsigned int)); req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) + RTA_LENGTH(sizeof(mtu)); memcpy(RTA_DATA(rta), &mtu, sizeof(mtu)); send(rtnetlink_sk, &req, req.nh.nlmsg_len); SEE ALSO
netlink(3), netlink(7), rtnetlink(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2012-03-24 RTNETLINK(3)
All times are GMT -4. The time now is 06:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy