Sponsored Content
Full Discussion: Shell script request
Top Forums Shell Programming and Scripting Shell script request Post 302617271 by udayakumar on Monday 2nd of April 2012 10:34:47 AM
Old 04-02-2012
Shell script request

I've a master file which will contain 100 file names, The script should read file name from a master file and format the file as below in AIX.

input file

Code:
Filename

This
is
a
test
file

Output File

Code:
Filename|This is a test file

Thanks in advance


Code:
for file in $FileList; do 
echo $file; 
FileName=`basename $file`; 
sed  's/^M//g' $file> "${file}"2;
mv "${file}"2 "${file}"; 
sed '1d'  "${file}" >"${file}"1; 
mv "${file}"1 $file; 
sed 's/^$/|/'|tr "\n\r" "  " > "${file}"1
mv "${file}"1 $file; 
done

This is doing nothing. I'm not good at sed. Please help.

Last edited by methyl; 04-02-2012 at 01:42 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How cgi(shell script) to receive the URL REQUEST from Front end (visual C++)?

I am facing a problem which is weblogic convert to CGI method. The original process is -> the Front End is using Visual C++, and backend is using WEBLOGIC the based programming is JAVA. The method for Weblogic to receive the request from Front end (Visual C++) thru URL. for example :... (0 Replies)
Discussion started by: ryanW
0 Replies

2. Shell Programming and Scripting

Shell Script to provide "answers" to SSL Cert Request

Hello, I need assistance with creating a shell script to generate SSL Certificate Requests on remote hosts. Below is my stab at this, but I cannot figure out how to pass the requested arguments into the openssl command correctly. I have a major problem with redirecting the "answers" into the... (2 Replies)
Discussion started by: azvelocat
2 Replies

3. Shell Programming and Scripting

Calling a request set from Unix shell Script

Hi All, I want to call a concurrent request set from a shell script. I am getting the syntax error "syntax error at line 417 : `(' unexpected" in the below script. v_request_id=fnd_request.submit_request(application => 'APPL_SHORT_NAME' ,program => 'PROGRAM_SHORT_NAME' ... (4 Replies)
Discussion started by: swatipevekar
4 Replies

4. Shell Programming and Scripting

Request for shell script for listing directories, subdirs containing specific files.

I'm looking for a script which outputs the list of directories and sub directories from root level consisting of specific files. For instance I want shell script to list all the directories and subdirectories containing .txt files.:wall: (4 Replies)
Discussion started by: super210
4 Replies

5. UNIX for Dummies Questions & Answers

Script shell calculate mean arrival request duration

hello, I have implemented this command : tshark -eth0 -T fiels -e frame.time et sip.Request-Line -z sip,stat > test2.txt the result of this command : test.txt: Aug 27, 2013 23:06:47.334270000 INVITE Aug 27, 2013 23:06:47.335045000 SIP/2.0 401 Unauthorized Aug 27, 2013... (1 Reply)
Discussion started by: Amouna
1 Replies

6. Shell Programming and Scripting

Shell program request

Hello, I'm requesting the shell program to compare 2 .csv files which will have large data. Can any one help me with this linux shell program Thanks in advance. Thanks and regards Ramanjaneya. K (1 Reply)
Discussion started by: pandu19
1 Replies

7. Shell Programming and Scripting

Shell program request to download .pdf files

Hello, Would you suggest me a shell program that would launch the given url and if there is login we have enter the credentials. If the credentials are correct it would be redirected to home page of that url, the program will check if there are any PDF'S found automatically the PDF'S have... (5 Replies)
Discussion started by: pandu19
5 Replies

8. Shell Programming and Scripting

Get Parameter with Shell request

How can I get Parameters with Shell Request. I mean so but not work: PHP: error_reporting(E_ALL); $hallo ="Hallo Welt"; print_r(shell_exec("sh client.sh $hallo")); Shell: echo $hallo echo ceck (5 Replies)
Discussion started by: Linuxmann
5 Replies

9. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
Locale::Codes::LangVar(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangVar(3pm)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lvar = code2langvar('en','alpha-2'); $lvar = code2langvar('en',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangVar(3pm)
All times are GMT -4. The time now is 11:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy