Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Bash does not wrap long lines correctly Post 302825501 by senthil.ak on Monday 24th of June 2013 01:28:25 PM
Old 06-24-2013
RedHat Bash does not wrap long lines correctly

Ksh is my default shell, but I want use the bash shell since its convenient to me.

When I type a long command line in a terminal, it does not wrap to the next line when I reach the end of the line and it wraps onto the same line, overwriting my prompt and the rest of what I typed.

Code:
$ echo $SHELL
  /bin/ksh
  $ ve and accept responsve and accept responsve and accept responsve and accept responsve and accept responsve and accept responsve and accept responsve and accept responsve and accept responsve
  $ bash
   ash-3.2$ sponsve and ae asponsve and ae asponsve and ae asponsve and ae asponsve and ae asponsve and ae asponsve and ae
  bash-3.2$ stty -a
  speed 38400 baud; rows 44; columns 120; line = 0;
  intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
  stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
  -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
  -ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany imaxbel -iutf8
  opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
  isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
  bash-3.2$ tput cols
  120
  bash-3.2$ echo $TERM
  xterm
  bash-3.2$ export TERM="vt100"
  bash-3.2$ echo $TERM
  vt100
   ae and accept responsve and ae and accept responsve and ae and accept responsve and ave and ae and accept responsve and
  bash-3.2$

I searched in the Unix and internet, all problem solved by modifying the customized PS1 command but I don't have any customized prompt I am using default one.



Thnaks
Senthil.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Re: Long command lines

Hello, AIM: Need to test for the presence of some files (*.F) in a certain directory. having a problem with this line is ksh: if test `ls $SOMEDIR/dir/*.F \ 2>/dev/null|wc -w` -eq 0 Basically testing for the presence of *.F files in the specified directory. If the return... (4 Replies)
Discussion started by: enoch
4 Replies

2. UNIX for Dummies Questions & Answers

removing lines in a too long file

HI, i need to remove about a 3000000 lines in a "too long file", without using vi editor. Im using hp-ux 11.0. (4 Replies)
Discussion started by: Goodfella
4 Replies

3. Shell Programming and Scripting

How to get BASH to interpret pipes in a string correctly?

In a BASH library I'm creating, I have two functions that look like: function check_process { PIDFILE=$1 if ; then PID=`cat $PIDFILE` if && ; then return 1 fi; fi; return 0 } function fork_process { CMD=$1 PIDFILE=$2 ... (2 Replies)
Discussion started by: neked
2 Replies

4. UNIX for Dummies Questions & Answers

Lines too long error

Hi Gurus, I have a big file having around 5000 lines. What I need to do is as below. $cat myfile aaaa bbbb ccc ddd ... I want the output to be as below: 'aaaa,'bbbb','cccc'.... For this I have written something like this code: vi sac.txt |nawk '{printf NR","}'>ss code: (2 Replies)
Discussion started by: thana
2 Replies

5. Shell Programming and Scripting

splitting long string into several lines?

I'm using a barcode scanner to grab ISBNs. Unfortunately, short of hitting "enter" each time (not easy while on a ladder), there's no good way to split it up. So I scanned it into a series of long lines in notepad. Now, I need to split each line into 12-number lines. instead of:... (4 Replies)
Discussion started by: mbourgon
4 Replies

6. Shell Programming and Scripting

Wrap lines with awk to create SQL script

Greetings! Some of my files list hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like "No error", else I display the error from the file itself. I came up with this (with help) for myfile in `find . -name... (2 Replies)
Discussion started by: alan
2 Replies

7. Shell Programming and Scripting

Geographical distance between long and lat in bash

Does anyone know of any script or packages that allow the calculation of the geographical distance between two points of lat/long from within a bash shell? I have been searching the web for the past few days and none of the options seem compatible with bash variables... (eg. geodist) Many... (3 Replies)
Discussion started by: lily-anne
3 Replies

8. UNIX for Dummies Questions & Answers

sed and awk for long lines

Hi, I'm trying make a variable length file to a fixed length of 4000. I'm to pad spaces on the right of a record if length is less than 4000 to make the record length 4000. I'm trying to use the below commands awk '{printf "%-4000s\n", $0}' inputfile.dat > outputfile.dat sed -e :a... (12 Replies)
Discussion started by: uxusr
12 Replies

9. Shell Programming and Scripting

Perl one liner to wrap comment lines

Greetings fellow scripters. I find myself editing multiple files, sometimes with the same bits of information. My bash script, a changelog, and a plist file (OS X). Once I realized this, I thought why not script part of this process (and so it begins). In any case, I've solved several of the... (1 Reply)
Discussion started by: reid
1 Replies

10. Programming

Fork and Execvp Not Executing Bash Commands From C correctly.

I had been looking at page 75 of this online book: http://richard.esplins.org/static/downloads/linux_book.pdf I've used the system function in C to call bash commands before, but wanted to learn this way too. The solution in the book worked perfectly. However, I tried changing the simple "ls -l... (3 Replies)
Discussion started by: Azrael
3 Replies
WRAP-AND-SORT(1)					      General Commands Manual						  WRAP-AND-SORT(1)

NAME
wrap-and-sort - wrap long lines and sort items in Debian packaging files SYNOPSIS
wrap-and-sort [options] DESCRIPTION
wrap-and-sort wraps the package lists in Debian control files. By default the lists will only split into multiple lines if the entries are longer than 80 characters. wrap-and-sort sorts the package lists in Debian control files and all .install files. Beside that wrap-and-sort removes trailing spaces in these files. This script should be run in the root of a Debian package tree. It searches for control, control.in, copyright, copyright.in, install, and *.install in the debian directory. OPTIONS
-h, --help Show this help message and exit. -a, --wrap-always Wrap all package lists in the Debian control file even if the entries are shorter than 80 characters and could fit in one line line. -s, --short-indent Only indent wrapped lines by one space (default is in-line with the field name). -b, --sort-binary-packages Sort binary package paragraphs by name. -k, --keep-first When sorting binary package paragraphs, leave the first one at the top. Unqualified debhelper(7) configuration files are applied to the first package. -n, --no-cleanup Do not remove trailing whitespaces. -d path, --debian-directory=path Location of the debian directory (default: ./debian). -f file, --file=file Wrap and sort only the specified file. You can specify this parameter multiple times. All supported files will be processed if no files are specified. -v, --verbose Print all files that are touched. AUTHORS
wrap-and-sort and this manpage have been written by Benjamin Drung <bdrung@debian.org>. Both are released under the ISC license. DEBIAN
Debian Utilities WRAP-AND-SORT(1)
All times are GMT -4. The time now is 08:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy