Sponsored Content
Top Forums Shell Programming and Scripting UNIX script / Command >>> in one line Post 302574142 by Corona688 on Wednesday 16th of November 2011 03:11:11 PM
Old 11-16-2011
Yet again and forevermore I deeply sympathize with anyone forced to use that.

This code will only work in an actual shell. If SAP doesn't run it in an actual shell, it'll give you errors like `outputFile="/tmp/out.html"': command not found

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

 

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
LEARN(1)						      General Commands Manual							  LEARN(1)

NAME
learn - computer aided instruction about UNIX SYNOPSIS
learn [ -directory ] [ subject [ lesson ] ] DESCRIPTION
Learn gives Computer Aided Instruction courses and practice in the use of UNIX, the C Shell, and the Berkeley text editors. To get started simply type learn. If you had used learn before and left your last session without completing a subject, the program will use information in $HOME/.learnrc to start you up in the same place you left off. Your first time through, learn will ask questions to find out what you want to do. Some questions may be bypassed by naming a subject, and more yet by naming a lesson. You may enter the lesson as a number that learn gave you in a previous session. If you do not know the lesson number, you may enter the lesson as a word, and learn will look for the first lesson containing it. If the lesson is `-', learn prompts for each lesson; this is useful for debugging. The subject's presently handled are files editor vi morefiles macros eqn C There are a few special commands. The command `bye' terminates a learn session and `where' tells you of your progress, with `where m' telling you more. The command `again' re-displays the text of the lesson and `again lesson' lets you review lesson. There is no way for learn to tell you the answers it expects in English, however, the command `hint' prints the last part of the lesson script used to evaluate a response, while `hint m' prints the whole lesson script. This is useful for debugging lessons and might possibly give you an idea about what it expects. The -directory option allows one to exercise a script in a nonstandard place. FILES
/usr/share/learn subtree for all dependent directories and files /usr/tmp/pl* playpen directories $HOME/.learnrc startup information SEE ALSO
csh(1), ex(1) B. W. Kernighan and M. E. Lesk, LEARN - Computer-Aided Instruction on UNIX BUGS
The main strength of learn, that it asks the student to use the real UNIX, also makes possible baffling mistakes. It is helpful, espe- cially for nonprogrammers, to have a UNIX initiate near at hand during the first sessions. Occasionally lessons are incorrect, sometimes because the local version of a command operates in a non-standard way. Occasionally a lesson script does not recognize all the different correct responses, in which case the `hint' command may be useful. Such lessons may be skipped with the `skip' command, but it takes some sophistication to recognize the situation. To find a lesson given as a word, learn does a simple fgrep(1) through the lessons. It is unclear whether this sort of subject indexing is better than none. Spawning a new shell is required for each of many user and internal functions. The `vi' lessons are provided separately from the others. To use them see your system administrator. 7th Edition October 22, 1996 LEARN(1)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy