Sponsored Content
Top Forums Shell Programming and Scripting How to Add space at the end of each line in linux Post 302550953 by Manju87 on Monday 29th of August 2011 02:34:34 AM
Old 08-29-2011
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
 

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

Add a space at end of file

Hi I guess this is very simple.... I want to add a space at the last line in a file. The space has to be the last charachter on the last line, not at a new line. Anyone ?? (7 Replies)
Discussion started by: disel
7 Replies

5. Shell Programming and Scripting

Get the 1st 99 characters and add new line feed at the end of the line

I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed). AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies

6. 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

7. 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

8. 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

9. 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

10. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: trogne
1 Replies
exit(1)                                                            User Commands                                                           exit(1)

NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps SYNOPSIS
sh exit [n] return [n] csh exit [ ( expr )] goto label ksh *exit [n] *return [n] DESCRIPTION
sh exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of the last command executed (an EOF will also cause the shell to exit.) return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe- cuted. csh exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the expression expr. The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to jump to a label that occurs between a while or for built-in command and its corresponding end. ksh exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit except for a shell which has the ignoreeof option (See set below) turned on. return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return is invoked while not in a function or a '.' script, then it is the same as an exit. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 exit(1)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy