hi there
i'm trying to delete blank lines and or lines with spaces only from a series of files in an directory.
to do so, i'm using this:
for files in `ls /users/myname/pesop* 2>/dev/null`
do
grep -v ^$ $files > newfile
mv newfile $files
done
now, this works great for blank lines but... (3 Replies)
Hi
The following command read a string from the keyboard & echo it back.
$ read S;echo "$S"
ABCD
ABCD
As you see, the input has space. while it echo back the spaces are removed. Is there a way to keep the input intact and not removing any spaces? Also, the number of spaces may vary.
... (3 Replies)
Hi ,
I am currently using the while loop in bash shell, as follows.
while read line
do
echo $line
done < file.txt
However, i want to use the while loop on file.txt, which will read the file with 4 lines of gap.
Ex- if file.txt is a file of 100 lines, then i want to use the loop such... (3 Replies)
Hi there !
I need to treat files with variable line length, and process the tab-delimited words of each line. The tools I know are some basic bash scripting and sed ... I haven't got to python or perl yet.
So my file looks like this
obj1 0.01953 0.34576 0.04418 0.01249
obj2 0.78140... (7 Replies)
Hi
I am a newbie to unix. I have a current script that reads a directory for excel files and renames the files. There is a problem now because some of the files have spaces. If I put quotes on the file, it will work but I dont know how to read all the files with quotes.
Variables
$1 =... (6 Replies)
Dear All,
i facing problem to use string having spaces in for loop..
file used for FOR LOOP
command.txt
rpm -t -v ttm -D -r RJLL -h YELP
rpm -t -v ttm -D -r RJLL -h ERRT
rpm -t -v ttm -D -r RJLL -h TYYE
rpm -t -v ttm -D -r RJLL -h POOL
CODE using for execute above command... (3 Replies)
hi
i have a file which store some data.the contents of my file is
data1:data2
data3:data4
i have a script which read this file
correct="$(cat /root/sh | cut -d: -f1)"
i used this syntax..please help me which syntax is used to read blank spaces.and then remove it and after that how to read... (1 Reply)
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Hello All,
I have a file with data as below. Each line consists of 21 fields. I am not able to load them back to the database.
50733339,"834","834 ","005010X279A1","N","Y","007977163","0001 ",30,"2110D ","EB ","EB007 ","2 ","Conditional Required Data Element Miss
ing... (3 Replies)
I have a file which has following content:
NAME=ora.DG1.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE
NAME=ora.DG2.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE
NAME=ora.DG3.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE
NAME=ora.DG4.dg... (7 Replies)
Discussion started by: rcc50886
7 Replies
LEARN ABOUT FREEBSD
echo
ECHO(1) BSD General Commands Manual ECHO(1)NAME
echo -- write arguments to the standard output
SYNOPSIS
echo [-n] [string ...]
DESCRIPTION
The echo utility writes any specified operands, separated by single blank (' ') characters and followed by a newline ('
') character, to the
standard output.
The following option is available:
-n Do not print the trailing newline character.
The end-of-options marker -- is not recognized and written literally.
The newline may also be suppressed by appending 'c' to the end of the string, as is done by iBCS2 compatible systems. Note that the -n
option as well as the effect of 'c' are implementation-defined in IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002. For porta-
bility, echo should only be used if the first argument does not start with a hyphen ('-') and does not contain any backslashes (''). If
this is not sufficient, printf(1) should be used.
Most shells provide a builtin echo command which tends to differ from this utility in the treatment of options and backslashes. Consult the
builtin(1) manual page.
EXIT STATUS
The echo utility exits 0 on success, and >0 if an error occurs.
SEE ALSO builtin(1), csh(1), printf(1), sh(1)STANDARDS
The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.
BSD November 12, 2010 BSD