Sponsored Content
Top Forums Shell Programming and Scripting UNIX script / Command >>> in one line Post 302574136 by rbadveli on Wednesday 16th of November 2011 02:48:29 PM
Old 11-16-2011
UNIX script / Command >>> in one line

Hi Experts,

Basically I am a SAP programmer. I don't know much about UNIX. But I got a situation, need to use UNIX script /command in my programming.

I searched the forum and found the below code.

I would like to pass the below UNIX script in my programming code. But my programming will not allow line by line.
Can I able to pass below script in one single line.

Please share your answers.

============
Code:
outputFile="/tmp/out.html" 
( 
echo "From: abc@xyz" 
echo "To: def@xyz" 
echo "MIME-Version: 1.0" 
echo "Subject: Test" 
echo "Content-Type: text/html" 
cat $outputFile 
) | sendmail -t

============

Thanks in Advance
Raghu

Last edited by pludi; 11-16-2011 at 06:46 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix Script with line number at beginning of each line.

Could anybody help me. I need to create a script that reads a text file from STDIN and prints out the file to STDOUT with line numbers at the beginning of each line. Thanks. (5 Replies)
Discussion started by: mascorro
5 Replies

2. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

3. UNIX for Advanced & Expert Users

unix command : how to insert text at the cursor location via command line?

Hi, Well my title isn't very clear I think. So to understand my goal: I have a script "test1" #!/bin/bash xvkbd -text blabla with xbindkeys, I bind F5 key in order it runs my test1 script So when I press F5, test1 runs. I'm under Emacs/Vi and I press F5 in order to have "blabla" be... (0 Replies)
Discussion started by: xib.be
0 Replies

4. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

5. Shell Programming and Scripting

Specify an entire UNIX command as a command line argument

I'm trying to write a bash script called YN that looks like the following YN "Specify a question" "doThis" "doThat" where "doThis" will be executed if the answer is "y", otherwise "doThat". For example YN "Do you want to list the file dog?" "ls -al dog" "" Here's my attempt... (3 Replies)
Discussion started by: LeoKSimon
3 Replies

6. Shell Programming and Scripting

How to read a file, line by line in UNIX script?

#!/bin/bash file1="yxd" for file in `cat file3.txt`; do cat $file1 | awk '{split($1,dp,"."); lend=length(dp); if(lend>2) { dom=dp"."dp; split($2,ipl,","); for(i=1; i<=length(ipl); i++) { if(ipl~/:/) { if(ipl~/:/) i++; rip=ipl; i++; raq=ipl; rtq=0; si=i+4; for(;i<si;i++) rtq+=ipl; rsub="";... (2 Replies)
Discussion started by: veeruasu
2 Replies

7. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies

8. Shell Programming and Scripting

Calling another Script from Command Line in UNIX

Hi all, I am having problem in understanding the following line of code .. /home/rmsbatch/autoscript/autorms.ksh dc_load_main.ksh -q belk_dc_load_tran_data.seq What's being done here ? what does "-q" means ? What does ".seq" file means in unix "belk_dc_load_tran_data.seq" Please... (3 Replies)
Discussion started by: LoneRanger
3 Replies

9. UNIX for Advanced & Expert Users

Converting xls file to xlsx on UNIX script / command line.

Hi All, Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
Discussion started by: arvindshukla81
2 Replies

10. Shell Programming and Scripting

Shell script UNIX to read text file line by line

i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name data_file.txt column_name file_name col1 file1 col2 file2 col3 file1 col4 file1 col5 file2 now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
mkmanifest(1)						      General Commands Manual						     mkmanifest(1)

NAME
mkmanifest - mtools utility to create a shell script to restore UNIX file names from DOS SYNOPSIS
mkmanifest [files] OPTIONS
None OPERANDS
A list of UNIX file names to be converted to DOS name format. DESCRIPTION
The mkmanifest command creates a shell script that aids in the restore of UNIX file names that were overwritten by DOS file name restric- tions. DOS file names are uppercase only, cannot exceed 8 character names, 3 character extensions and do not support device names or non- alphanumeric characters. Not all UNIX file names are supported in the DOS world. The mtools commands may have to change UNIX names to fit the DOS file name conven- tions. Most commands provide the verbose option (-v), that displays new file names if they have been changed. The following table shows some examples of file name conversions: ----------------------------------------------- UNIX name DOS name Reason for the change ----------------------------------------------- thisisatest THISISAT file name too long file.stuff FILE.STU extension too long prn.txt XRN.TXT PRN is a device name .abc X.ABC null file name hot+cold HOTXCOLD illegal character ----------------------------------------------- EXIT STATUS
The following exit values are returned: Success. Failure. EXAMPLES
Assume you have the following UNIX files that you want to copy to a DOS diskette using the mcopy command. very_long_name 2.many.dots illegal: good.c prn.dev Capital The mcopy command converts these file names to the following: very_lon 2xmany.dot illegalx good.c xprn.dev capital To restore the previous file names, use the mkmanifest command as follows: mkmanifest very_long_name 2.many.dots illegal: good.c prn.dev Capital > manifest The previous mkmanifest command line produces the following: mv very_lon very_long_name mv 2xmany.dot 2.many.dots mv illegalx illegal: mv xprn.dev prn.dev mv capital Capital The good.c file name did not require conversion, hence it was not included in the output. If these files were copied from diskette to another UNIX system, and you wanted to restore the original names, retain a copy of the mani- fest file (captured output) so that it can be used to convert the file names again. FILES
Executable file SEE ALSO
Commands: mcopy(1), mtools(1) mkmanifest(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy