Sponsored Content
Top Forums Shell Programming and Scripting Writing to a file in different way Post 302071019 by mahendramahendr on Tuesday 11th of April 2006 11:46:20 AM
Old 04-11-2006
$ x="mah"
$ y="abc"
$ z="123"
$ echo "$x\n$y\n$z" > a.out
$ more a.out
mah
abc
123


I guess you are trying to do something else other than what you have mentioned above... can you post your full script here and the output
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

writing to a file

Hi All. I have the following simple shell program. It reads a number from the "/user/amit/bldno"; for example: file "bldno" contains value "100" After execution of the program the content should change to 101. --------- #!/usr/bin/tcsh V= `cat /user/amit/bldno` echo $V `rm -rf ... (1 Reply)
Discussion started by: amitrajvarma
1 Replies

2. UNIX for Dummies Questions & Answers

Problem writing file path to txt file

if test -z "$1" then echo "you must give a filename or filepath" else path=`dirname $1` f_name =`basename $1` if path="." then path=`pwd` fi fi cat $f_name $path >> index.txt The only problem I am encountering with this is writing $path to index.txt Keeps going gaga: cat:... (1 Reply)
Discussion started by: Vintage_hegoog
1 Replies

3. Programming

Writing a file in C

Hi All I am new to C and trying to write a code to get a file as an output. My text file should look like: <var1>tab<var2>tab<var3>...upto the elements in an array <varb1>tab<varb2>tab<varb3>...upto the elements in an array Can someone please guide me how to write the code or a sample... (3 Replies)
Discussion started by: amitsinha
3 Replies

4. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

5. Shell Programming and Scripting

Comparing rows in same file and writing the result in new file

Help needed... Can you tell me how to compare the last two couple entries in a file and print their result in new file..:confused: I have one file Check1.txt \abc1 12345 \abc2 12327 \abc1 12345 \abc2 12330 I want to compare the entries in Check1 and write to... (1 Reply)
Discussion started by: kichu
1 Replies

6. Shell Programming and Scripting

Writing file name and date from LS command into a file to be imported into mysql

I am looking to do a ls on a folder and have the output of the ls be structured so that is is modificaiton date, file name with the date in a format that is compatible with mysql. I am trying to build a table that stores the last modification date of certain files so I can display it on some web... (4 Replies)
Discussion started by: personalt
4 Replies

7. Shell Programming and Scripting

reading a file extracting information writing to a file

Hi I am trying to extract information out of a file but keep getting grep cant open errors the code is below: #bash #extract orders with blank address details # # obtain the current date # set today to the current date ccyymmdd format today=`date +%c%m%d | cut -c24-31` echo... (8 Replies)
Discussion started by: Bruble
8 Replies

8. UNIX for Dummies Questions & Answers

Need help in not fetching a file while file writing operation is not completed

Hi All, We have a Unix program in oracle when we run the program this connects to specified ftp and will get the file into local server. We are facing a problem like when file writing operations is not completed, this program is getting the incomplete file. Could anyone please help me... (2 Replies)
Discussion started by: world.apps
2 Replies

9. UNIX for Dummies Questions & Answers

Writing a script that will take the first line from each file and store it in an output file

Hi, I have 1000 files names data1.txt through data1000.txt inside a folder. I want to write a script that will take each first line from the files and write them as output into a new file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

10. Shell Programming and Scripting

awk - writing matching pattern to a new file and deleting it from the current file

Hello , I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file. Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies
UNISAP(3)						   BSD Library Functions Manual 						 UNISAP(3)

NAME
unimsg, unisve_check_addr, unisve_check_selector, unisve_check_blli_id2, unisve_check_blli_id3, unisve_check_bhli, unisve_check_sap, unisve_overlap_addr, unisve_overlap_selector, unisve_overlap_blli_id2, unisve_overlap_blli_id3, unisve_overlap_bhli, unisve_overlap_sap, unisve_is_catchall, unisve_match -- ATM signalling library - ATM SAP handling LIBRARY
Begemot ATM signalling library (libunimsg, -lunimsg) SYNOPSIS
#include <uni4/unisap.h> int unisve_check_addr(const struct unisve_addr *sve); int unisve_check_selector(const struct unisve_selector *sve); int unisve_check_blli_id2(const struct unisve_blli_id2 *sve); int unisve_check_blli_id3(const struct unisve_blli_id3 *sve); int unisve_check_bhli(const struct unisve_bhli *sve); int unisve_check_sap(const struct uni_sap *sve); int unisve_overlap_addr(const struct unisve_addr *sve1, const struct unisve_addr *sve2); int unisve_overlap_selector(const struct unisve_selector *sve1, const struct unisve_selector *sve2); int unisve_overlap_blli_id2(const struct unisve_blli_id2 *sve1, const struct unisve_blli_id2 *sve2); int unisve_overlap_blli_id3(const struct unisve_blli_id3 *sve1, const struct unisve_blli_id3 *sve2); int unisve_overlap_bhli(const struct unisve_bhli *sve1, const struct unisve_bhli *sve2); int unisve_overlap_sap(const struct uni_sap *sap1, const struct uni_sap *sap2); int unisve_is_catchall(const struct uni_sap *sap); int unisve_match(const struct uni_sap *sap, const struct uni_ie_called *called, const struct uni_ie_blli *blli, const struct uni_ie_bhli *bhli); DESCRIPTION
The unimsg library contains functions to handle Service Access Points (SAP) and SAP Vector Elements (SVE) as specified in the ATM Forum ATM API Semantic Description. SAPs are the analog of TCP and UDP ports in the ATM world. As usually in ATM they are a couple of orders of mag- nitude more complex as their Internet equivalent. See the ATM Forum document for a description. A SAP is a data structure: struct uni_sap { struct unisve_addr addr; struct unisve_selector selector; struct unisve_blli_id2 blli_id2; struct unisve_blli_id3 blli_id3; struct unisve_bhli bhli; }; that consists of 5 elements matching different information elements in the SETUP message. Each of these elements has a tag that defines how the SVE is to be matched with the information element. The tag is one of UNISVE_ABSENT The information element has to absent from the SETUP message. UNISVE_PRESENT The information element has to be present in the SETUP message and must match the SVE. UNISVE_ANY The information element may be absent from the SETUP message or may have any value. The called address is matched by a struct unisve_addr { enum unisve_tag tag; enum uni_addr_type type;/* type of address */ enum uni_addr_plan plan;/* addressing plan */ uint32_t len; /* length of address */ u_char addr[UNI_ADDR_MAXLEN]; }; Here type is the type of address and plan is the address plan. len is the length of the address (for ATME addresses not counting the selec- tor byte) and addr is the address itself. In case of ATME addresses the selector byte is matched by a struct unisve_selector { enum unisve_tag tag; uint8_t selector; }; Here selector is the selector byte that must match the 20th byte of the ATME calling address from the SETUP message. The BLLI information element is matched by two SVEs: one for layer 2 options and one for layer 3 options. The layer 2 SVE is: struct unisve_blli_id2 { enum unisve_tag tag; uint8_t proto:5;/* the protocol */ uint8_t user:7; /* user specific protocol */ }; Where the user fields is matched only if the proto field specifies UNI_BLLI_L2_USER. The layer 3 SVE is: struct unisve_blli_id3 { enum unisve_tag tag; uint8_t proto:5;/* L3 protocol */ uint8_t user:7; /* user specific protocol */ uint8_t ipi:8; /* ISO/IEC TR 9557 IPI */ uint32_t oui:24; /* IEEE 802.1 OUI */ uint32_t pid:16; /* IEEE 802.1 PID */ uint32_t noipi; /* ISO/IEC TR 9557 per frame */ }; For the exact rules how matching occures refer to the source code or the ATM Forum document. Finally the BHLI information element is matched with a struct unisve_bhli { enum unisve_tag tag; enum uni_bhli type; /* type of info */ uint32_t len; /* length of info */ uint8_t info[8];/* info itself */ }; For each SVE type there is a function that checks whether the SVE is correct specified. The functions unisve_check_addr(), unisve_check_selector(), unisve_check_blli_id2(), unisve_check_blli_id3(), and unisve_check_bhli() return one of the following error codes: enum { UNISVE_OK = 0, UNISVE_ERROR_BAD_TAG, UNISVE_ERROR_TYPE_PLAN_CONFLICT, UNISVE_ERROR_ADDR_SEL_CONFLICT, UNISVE_ERROR_ADDR_LEN, UNISVE_ERROR_BAD_ADDR_TYPE, UNISVE_ERROR_BAD_BHLI_TYPE, UNISVE_ERROR_BAD_BHLI_LEN, }; A code of UNISVE_OK means that the SVE has no error. The function unisve_check_sap() checks a complete SAP and returns one of the above codes. There is a definition UNISVE_ERRSTR that evaluates to a comma separated list of strings that can be used to initializes an array of char pointers to map the error codes into human readable strings. The ATM Forum document defines the concept of overlaping SAPs. This basically means, that an incoming SETUP could match more than one SAP (and more than one application) to receive the SETUP. For each SVE type there is a function that checks whether two SVEs overlap and there is a function that checks whether two SAPs overlap. The functions unisve_overlap_addr(), unisve_overlap_selector(), unisve_overlap_blli_id2(), unisve_overlap_blli_id3(), unisve_overlap_bhli(), and unisve_overlap_sap() return 1 if the SVEs or SAPs overlap and 0 if they do not. They assume, that the SAPs are correct. The ATM Forum document specifies a catch-all SAP. The function unisve_is_catchall() returns 1 if the SAP is the catch-all SAP and 0 other- wise. Finally the function unisve_match() is used to match a SAP against the information elements from a SETUP message. It returns 1 if they match and 0 otherwise. SEE ALSO
libunimsg(3) AUTHORS
Hartmut Brandt <harti@FreeBSD.org> BSD
June 14, 2005 BSD
All times are GMT -4. The time now is 11:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy