Sponsored Content
Top Forums Shell Programming and Scripting sed in script creates output file ending with '?' (^M) Post 302466700 by jennykay on Wednesday 27th of October 2010 05:40:45 AM
Old 10-27-2010
sed in script creates output file ending with '?' (^M)

Hi,

I'm trying to use sed within a shell script (bash, running ubuntu). The command works fine from the command line, but when I use it within the script, rather than creating a file with the name I've specified, it creates one that ends with a question mark '?' when you use ls, e.g. outfile.cvs? and with '^M' when completing the name with tab, e.g. outfile.cvs^M

Here is my sed command:

sed 's/","/";"/g' infile.cvs >outfile.cvs

Because I then call the outfile for the next step in my script, this is a problem. The file itself looks fine.

Thanks for any help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed find word ending with

Hi I want to use sed to find words ending in a pattern and then have it delete these words. Not sure if there is a better command to do this. I was thinking of a find and replace but I'm not sure of the syntax to look for a word ending with this pattern and not sure how to replace the whole word. (2 Replies)
Discussion started by: eltinator
2 Replies

2. Shell Programming and Scripting

To parse through the file and print output using awk or sed script

suppose if u have a file like that Hen ABCCSGSGSGJJJJK 15 Cock ABCCSGGGSGIJJJL 15 * * * * * * : * * * . * * * : Hen CFCDFCSDFCDERTF 30 Cock CHCDFCSDHCDEGFI 30 * . * * * * * * * : * * :* : : . The output shud be where there is : and . It shud... (4 Replies)
Discussion started by: cdfd123
4 Replies

3. Shell Programming and Scripting

How to delete ending/trailing spaces using awk,sed,perl?

How to delete ending/trailing spaces using awk,sed,perl? Input:(each line has extra spaces at the end) 3456 565 3 7 35 878 Expected output: 3456 565 3 7 35 878 (5 Replies)
Discussion started by: cola
5 Replies

4. Shell Programming and Scripting

Script sometimes creates an empty file

I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies

5. Shell Programming and Scripting

Script sometimes creates an empty file

I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies

6. Shell Programming and Scripting

Script that creates directory structure

Hi All, I have a script that does daily checks on my storage environment and is run from an AIX host. The script currently works great but I have been changing and updating bits of it to make it easier for my lesser colleagues to understand :p However now with the updates I have made I... (1 Reply)
Discussion started by: colinwilson1303
1 Replies

7. Shell Programming and Scripting

Writing a script that creates a 1GB file with zeros using dd

I am new to Linux. Using latest version of Ubuntu. I want to make a script that creates a 1GB file filled with zeros using dd and then formats the file as vfat with a label of "MYFILE". If anyone can help me it would be appreciated. (9 Replies)
Discussion started by: paviter619
9 Replies

8. Red Hat

Script creates additional file

Hi, I have created a test script like this : # cat script1.sh DAY=$(date +%d) MONTH=$(date +%b) YEAR=$(date +%Y) BC01="Blast_BC01" BC15="Blast_BC15" DIR1="$MONTH$YEAR_$BC01" DIR2="$MONTH$YEAR_$BC07" DIR3="$MONTH$YEAR_$BC15" if ;then mkdir -p "$YEAR/$DIR3" fi # When I... (5 Replies)
Discussion started by: anaigini45
5 Replies

9. Shell Programming and Scripting

Writing a script that creates a 1GB file with zeros using dd

I am new to Linux. Using latest version of Ubuntu. I want to make a script that creates a 1GB file filled with zeros using dd and then formats the file as vfat with a label of "MYFILE". If anyone can help me it would be appreciated. (1 Reply)
Discussion started by: amandasaza08
1 Replies

10. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies
CVS-DEBUILD(1)						      General Commands Manual						    CVS-DEBUILD(1)

NAME
cvs-debuild - build a Debian package using cvs-buildpackage and debuild SYNOPSIS
cvs-debuild [debuild options] [cvs-buildpackage options] [--lintian-opts lintian options] DESCRIPTION
cvs-debuild is a wrapper around cvs-buildpackage to run it with debuild as the package-building program. (This cannot simply be accom- plished using the -C option of cvs-buildpackage, as it does not know how to handle all of the special debuild options.) The program simply stashes the debuild and lintian options, and passes them to debuild when it is called by cvs-buildpackage. All of the standard debuild options may be used (as listed below), but note that the root command specified by any --rootcmd or -r command-line option will be passed as an option to cvs-buildpackage. The first non-debuild option detected will signal the start of the cvs-buildpackage options. The selection of the root command is slightly subtle: if there are any command-line options, these will be used. If not, then if cvs- buildpackage is set up to use a default root command, that will be used. Finally, if neither of these are the case, then debuild will use its procedures to determine an appropriate command, as described in its documentation. See the manpages for debuild(1) and cvs-buildpackage for more information about the behaviour of each. OPTIONS
The following are the debuild options recognised by cvs-debuild. All cvs-buildpackage and lintian options are simply passed to the appro- priate program. For explanations of the meanings of these variables, see debuild(1). --no-conf, --noconf --rootcmd=gain-root-command, -rgain-root-command --preserve-env --preserve-envvar=var, -evar --set-envvar=var=value, -evar=value --lintian, --no-lintian --ignore-dirname, --check-dirname These should not be needed, but it is provided nevertheless. SEE ALSO
cvs-buildpackage(1), debuild(1), dpkg-buildpackage(1) and lintian(1). AUTHOR
This program was written by Julian Gilbey <jdg@debian.org>. DEBIAN
Debian Utilities CVS-DEBUILD(1)
All times are GMT -4. The time now is 04:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy