Sponsored Content
Full Discussion: Multiple input on same line?
Top Forums UNIX for Dummies Questions & Answers Multiple input on same line? Post 302500743 by losingit on Tuesday 1st of March 2011 11:52:32 AM
Old 03-01-2011
Just figured out part of what I wanna do by doing this:

Code:
read -p  "Enter your name and age: " name age

Actually just thought of a part two to this. If this was a file named "bio" how could I set this up so that when I run bio at the command prompt I could type bio "name" "age" when running the file so it will run with these variables already assigned. Basicall I want to assign variables when file executes. I know Im asking alot here!

---------- Post updated at 11:52 AM ---------- Previous update was at 11:50 AM ----------

Why do you want my post removed out of curiosity?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to prompt for input & accept input in ONE line

hi, am a new learner to shell programming. i have a script which will prompt for user to key in their name & display their name afterwards. script ===== echo "Pls enter your name:" read name echo "Your name is $name." output ===== Pls enter your name: Bob Your name is Bob. what... (2 Replies)
Discussion started by: newbie168
2 Replies

2. Shell Programming and Scripting

single line input to multiple line output with sed

hey gents, I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Discussion started by: mitch
8 Replies

3. Shell Programming and Scripting

Input 2 files, calculate diffs line by line

Hi I am new to Unix and need help with the following (to you all I'm sure) simple task. I am trying to output the differences between previous snaphots of various filesystem sizes to the present sizes. I have three files (e.g.) : file 1 file 2 file 3 10 100 /var... (4 Replies)
Discussion started by: bigbuk
4 Replies

4. Shell Programming and Scripting

sed to read line by line and input into another file

I have two files. Fileone contains text string one text string two text string three Filetwo contains Name: Address: Summary: Name: Address: Summary: Name: Address: Summary: I would like to use sed to read each line of file one and put it at the end of the summary line of file... (3 Replies)
Discussion started by: dolacap
3 Replies

5. UNIX for Advanced & Expert Users

Input for multiple files.

Hi, I am trying to come up with a script, and would like the script to pick all the files place within a folder and interactive take my yes/no before processing within the command. Could you someone help me in modifying the script : #!/bin/bash # LDIF_FILES="File Name" for MY_FILE... (5 Replies)
Discussion started by: john_prince
5 Replies

6. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

7. Shell Programming and Scripting

Curl - input line by line from text file

Hi, I've got a text file with hundreds of lines I need to upload to an API via curl, one by one. The text file is like: 2012-08-01 10:45,124 2012-08-02 10:45,132 2012-08-03 10:45,114 I want to get curl to go through the text file sending a post for each line. like: curl --request... (0 Replies)
Discussion started by: emdeex
0 Replies

8. Shell Programming and Scripting

Command line multiple input

I'm using the below to get multiple input from USER and it is working, is there any better way in awk array single liner? echo "Enter Multiple input (Ctrl+d to exit)" >output while read A do echo "$A" >>output done (3 Replies)
Discussion started by: Roozo
3 Replies

9. Shell Programming and Scripting

Multiple file input

Once a time, I did see a way to multiply a file input in bash, but have forgotten how it was done. Eks. awk 'FNR==NR {a++;next} ($2 in a) {print $2}' file file Here you need file two times. I seen it some like this awk 'FNR==NR {a++;next} ($2 in a) {print $2}' 2&file (16 Replies)
Discussion started by: Jotne
16 Replies

10. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
BIO_f_base64(3SSL)						      OpenSSL							BIO_f_base64(3SSL)

NAME
BIO_f_base64 - base64 BIO filter SYNOPSIS
#include <openssl/bio.h> #include <openssl/evp.h> BIO_METHOD * BIO_f_base64(void); DESCRIPTION
BIO_f_base64() returns the base64 BIO method. This is a filter BIO that base64 encodes any data written through it and decodes any data read through it. Base64 BIOs do not support BIO_gets() or BIO_puts(). BIO_flush() on a base64 BIO that is being written through is used to signal that no more data is to be encoded: this is used to flush the final block through the BIO. The flag BIO_FLAGS_BASE64_NO_NL can be set with BIO_set_flags() to encode the data all on one line or expect the data to be all on one line. NOTES
Because of the format of base64 encoding the end of the encoded block cannot always be reliably determined. RETURN VALUES
BIO_f_base64() returns the base64 BIO method. EXAMPLES
Base64 encode the string "Hello World " and write the result to standard output: BIO *bio, *b64; char message[] = "Hello World "; b64 = BIO_new(BIO_f_base64()); bio = BIO_new_fp(stdout, BIO_NOCLOSE); bio = BIO_push(b64, bio); BIO_write(bio, message, strlen(message)); BIO_flush(bio); BIO_free_all(bio); Read Base64 encoded data from standard input and write the decoded data to standard output: BIO *bio, *b64, *bio_out; char inbuf[512]; int inlen; b64 = BIO_new(BIO_f_base64()); bio = BIO_new_fp(stdin, BIO_NOCLOSE); bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); bio = BIO_push(b64, bio); while((inlen = BIO_read(bio, inbuf, 512)) > 0) BIO_write(bio_out, inbuf, inlen); BIO_free_all(bio); BUGS
The ambiguity of EOF in base64 encoded data can cause additional data following the base64 encoded block to be misinterpreted. There should be some way of specifying a test that the BIO can perform to reliably determine EOF (for example a MIME boundary). SEE ALSO
TBA 1.0.1e 2013-02-11 BIO_f_base64(3SSL)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy