Sponsored Content
Top Forums Shell Programming and Scripting URGENT Reading a file and assessing the syntax shell script URGENT Post 302996898 by Gurdza32 on Thursday 4th of May 2017 04:11:38 AM
Old 05-04-2017
URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being read follows the syntax then it should be sent to another file called correct.txt if the syntax is incorrect of the line then it should be sent to incorrect.txt. I have been struggling to get the shell script to read the file and then assess the syntax. Please could someone help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Urgent help required in deleting a line without opening a file usinga shell script

Hi, I need a help in deleting a line matching a particular pattern in a file using shell script without opening the file. The file is a .c/.cpp file. Is it possible? Thanks (6 Replies)
Discussion started by: naan
6 Replies

2. Shell Programming and Scripting

Urgent: selecting unique specific content of a file using shell script

Hi, I have a file whose content and format at places is as given below. print coloumn .... coloumn .... coloumn .... skip 1 line print coloumn ... skip 1 line I need to select the following : print coloumn .... coloumn .... coloumn... (2 Replies)
Discussion started by: jisha
2 Replies

3. Shell Programming and Scripting

urgent-extracting block data from flat file using shell script

Hi, I want to extract block of data from flat file. the data will be like this start of log One two three end of log i want all data between start of log to end of log i.e One two three to be copied to another file. This particular block may appear multiple times in same file. I... (4 Replies)
Discussion started by: shirish_cd
4 Replies

4. Shell Programming and Scripting

Urgent for shell script

Hi friends, I am working as a DataStage developer. I need help in writing shell script. I have following file and I want to remove data from 1st field and store it into other file. Convert this file, A100 Tylenol 100mg A100 PCML 500mg B120 CFDR 250mg C345 PFLX 600mg ... (4 Replies)
Discussion started by: sunnysunny
4 Replies

5. Shell Programming and Scripting

Need urgent help for reading file

Hi, I am new to shell scripting. I have one .txt file whose name is status.txt Now i want to read the contents of this file in a variable. status.txt file contains the following input 1.xml 2.ps 3.pdf now i want to read this status.txt file. Can anybody please help me to write a... (2 Replies)
Discussion started by: sunitachoudhury
2 Replies

6. Shell Programming and Scripting

URGENT HELP NEEDED ON -File size reading

All Expert, I am using Sun OS 5.8 and Perl version 5 in One server and Perl 5.8 in another unix server. I am able to read a file using fopen function of perl --file size having more then 3 GB of data.(In the machine where Perl 5.8 install) But when i am running the same perl script --It... (1 Reply)
Discussion started by: jambesh
1 Replies

7. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

8. Shell Programming and Scripting

Urgent: Script.sh: syntax error at line 72: `PROGRESS=$' unexpected

I have written a shell script to Automatically FTP a file. The script runs fine when doing it manually but when I schedule it using a crontab it gives me an error. . . . echo "-----------------Starting File FTP---------------------" >> $PROS_LOAD_LOG echo "open X.XX.XX.XXX" >>... (13 Replies)
Discussion started by: tanhajoy
13 Replies

9. Shell Programming and Scripting

Reading a file passed as an argurement and assessing the files syntax

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (8 Replies)
Discussion started by: Gurdza32
8 Replies

10. Shell Programming and Scripting

Shell script urgent help please

Hello, I have below string, even I have hundreds of lines in a file. I want to exactly match last two consecutive strings. 2017-09-30|ACBD,TVF|01234|NULL|18|NULL|686091802|BANK OF ABCD, LIMITED, THE|2017-09-30 00:00:00 I want to extract the string 2017-09-30 00:00:00 How can I do... (1 Reply)
Discussion started by: shellquery26666
1 Replies
OPENSSL_PKCS7_SIGN(3)							 1						     OPENSSL_PKCS7_SIGN(3)

openssl_pkcs7_sign - Sign an S/MIME message

SYNOPSIS
bool openssl_pkcs7_sign (string $infilename, string $outfilename, mixed $signcert, mixed $privkey, array $headers, [int $flags = PKCS7_DETACHED], [string $extracerts]) DESCRIPTION
openssl_pkcs7_sign(3) takes the contents of the file named $infilename and signs them using the certificate and its matching private key specified by $signcert and $privkey parameters. PARAMETERS
o $infilename - o $outfilename - o $signcert - o $privkey - o $headers -$headers is an array of headers that will be prepended to the data after it has been signed (see openssl_pkcs7_encrypt(3) for more information about the format of this parameter). o $flags -$flags can be used to alter the output - see PKCS7 constants. o $extracerts -$extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for exam- ple be used to help the recipient to verify the certificate that you used. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 openssl_pkcs7_sign(3) example <?php // the message you want to sign so that recipient can be sure it was you that // sent it $data = <<<EOD You have my authorization to spend $10,000 on dinner expenses. The CEO EOD; // save message to file $fp = fopen("msg.txt", "w"); fwrite($fp, $data); fclose($fp); // encrypt it if (openssl_pkcs7_sign("msg.txt", "signed.txt", "mycert.pem", array("file://mycert.pem", "mypassphrase"), array("To" => "joes@example.com", // keyed syntax "From: HQ <ceo@example.com>", // indexed syntax "Subject" => "Eyes only") )) { // message signed - send it! exec(ini_get("sendmail_path") . " < signed.txt"); } ?> PHP Documentation Group OPENSSL_PKCS7_SIGN(3)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy