Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Removing control-m characters from shell script Post 302729783 by only4satish on Sunday 11th of November 2012 11:13:47 AM
Old 11-11-2012
is it a generic code to remove control M characters in a sample file

Code:
 
sed 's/'"$(printf '\015')"'//g' input_file > output_file

 

10 More Discussions You Might Find Interesting

1. Programming

Identifying and removing control characters in a file.

What is the best method to identify an remove control characters in a file. Would it be easier to do this in Unix or in C. (0 Replies)
Discussion started by: oracle8
0 Replies

2. Shell Programming and Scripting

Removing control-Ms (^M)

Anyone know how to remove ^M's from a text file using sed command? (6 Replies)
Discussion started by: djkane
6 Replies

3. Shell Programming and Scripting

control over shell script

Hi.. I have a perl program that uses "system" to execute a shell script called startengine. The script "startengine" itself calls a lot of other smaller scripts to setup the engine etc. It finally has to execute ./engine which is another shell script which is long and takes a long time to... (3 Replies)
Discussion started by: JLJ
3 Replies

4. Shell Programming and Scripting

How to Control Cronjobs using Shell Script??

Hi All, Now i am running the 3 oracle procedures one by one manually. Query: If 1st Procedure OUT_PUT is Success, then call 2nd Procedure. If 2nd Procedure OUT_PUT is Success, then call 3rd Procedure. If 1st Procedure is failed, then no need of calling the other ... (8 Replies)
Discussion started by: hanu_oracle
8 Replies

5. Shell Programming and Scripting

help removing characters for output file in shell script

hi i'm new to shell scripts and have a small problem i am running a batch converter that returns all flash .flv files in a directory and create a png image from each one the problem i have is the $1 variable , its ok on the first call but on the secound call $1.png , i have extra... (1 Reply)
Discussion started by: wingchun22
1 Replies

6. Shell Programming and Scripting

Control browser from shell script

I have a browser running in a separate virtual terminal and would like to be able to send shortcut codes (e.g. ctrl+A) to the browser (and have it react) from a bash script in a separate virtual terminal. I need to keep the script in the separate virtual terminal. (2 Replies)
Discussion started by: slak0
2 Replies

7. Shell Programming and Scripting

Version Control Through the Shell Script

Version Control Through the Shell Script Hi Guys, Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated. I want to maintain the Version control to all my scripts running in Production server, I am... (6 Replies)
Discussion started by: Anji
6 Replies

8. Shell Programming and Scripting

Removing special characters - Control M

I have developed a small script to remove the Control M characters that get embedded when we move any file from Windows to Unix. For some reason, its not working in all scenarios. Some times I still see the ^M not being removed. Is there anything missing in the script: cd ${inputDir}... (7 Replies)
Discussion started by: vskr72
7 Replies

9. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

10. UNIX for Dummies Questions & Answers

[solved]removing characters from a mass of file names

I found a closed thread that helped quite a bit. I tried adding the URL, but I can't because I don't have enough points... ? Modifying the syntax to remove ! ~ find . -type f -name '*~\!]*' | while IFS= read -r; do mv -- "$REPLY" "${REPLY//~\!]}"; done These messages are... (2 Replies)
Discussion started by: rabidphilbrick
2 Replies
LIPO(1) 						      General Commands Manual							   LIPO(1)

NAME
lipo - create or operate on universal files SYNOPSIS
lipo [-info] [-detailed_info] [-arch arch_type input_file] ... [ input_file] ... [-arch_blank arch_type] [-create] [-thin arch_type] [-replace arch_type filename] ... [-remove arch_type] ... [-extract arch_type] ... [-extract_family arch_type] ... [-verify_arch arch_type ...] [-output output_file] [-segalign arch_type value] ... DESCRIPTION
The lipo command creates or operates on ``universal'' (multi-architecture) files. It only ever produces one output file, and never alters the input file. The operations that lipo performs are: listing the architecture types in a universal file; creating a single universal file from one or more input files; thinning out a single universal file to one specified architecture type; and extracting, replacing, and/or removing architectures types from the input file to create a single new universal output file. Only one option can be specified, with the exception of -arch, -arch_blank, -output, and -segalign, which are used in combination with other options. The input_file argument is required, and only the -create option allows more than one input_file to be specified. The -output flag must be used, except with the -info and -detailed_info flags. The arch_type arguments may be any of the supported architecture names listed in the man page arch(3). OPTIONS
-info Briefly list the architecture types in the input universal file (just the names of each architecture). -detailed_info Display a detailed list of the architecture types in the input universal file (all the the information in the universal header, for each architecture in the file). -arch arch_type input_file Tells lipo that input_file contains the specified architecture type. The -arch arch_type specification is unnecessary if input_file is an object file, a universal file, or some other file whose architecture(s) lipo can figure out. -arch_blank arch_type Specifies that the output for the specified arch_type will be an MH_DYLIB_STUB file. This flag may not be used with any operation other than -create. -output output_file Specifies its argument to be the output file. -create Take the input files (or file) and create one universal output file from them. -thin arch_type Take one input file and create a thin output file with the specified arch_type. -replace arch_type file_name Take one universal input file; in the output file, replace the arch_type contents of the input file with the contents of the speci- fied file_name. -remove arch_type Take one universal input file and remove the arch_type from that universal file, placing the result in the output file. -extract arch_type Take one universal input file and copy the arch_type from that universal file into a universal output file containing only that architecture. -extract_family arch_type Take one universal input file and copy all of the arch_types for the family that arch_type is in from that universal file into an output file containing only those architectures. The file will be thin if only one architecture is found or universal otherwise. -verify_arch arch_type ... Take one input file and verify the specified arch_types are present in the file. If so then exit with a status of 0 else exit with a status of 1. -segalign arch_type value Set the segment alignment of the specified arch_type when creating a universal file containing that architecture. value is a hexa- decimal number that must be an integral power of 2. This is only needed when lipo can't figure out the alignment of an input file (currently not an object file), or when it guesses at the alignment too conservatively. The default for files unknown to lipo is 0 (2^0, or an alignment of one byte), and the default alignment for archives is 4 (2^2, or 4-byte alignment). SEE ALSO
arch(3) Apple Computer, Inc. September 12, 2006 LIPO(1)
All times are GMT -4. The time now is 02:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy