01-09-2013
Array from cli input
I need to create a bash array from the command line parameters. I only know how to do it when I know the number of parameters. But what do I do when I dont know the number of parameters?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear Friends,
I am doing a sh shell script , But I dont have any idea how to read value from user Keyboard and store them to an array .. Is it possible or not I am not also sure in sh shell script ?
EX:-
#! /bin/sh
read DATA
echo "DATA -" $DATA
echo "DATA -" $DATA
echo "DATA... (7 Replies)
Discussion started by: user_prady
7 Replies
2. Shell Programming and Scripting
Hi all
I have a little brainscratcher here.
I want to draw a pie chart from data in a text file.
The drawing of the graph works fine, if I insert the data manually into a 2d array.
Now I want to pull the data from a text file (which was created using a uniq -c command) see sample below.... (2 Replies)
Discussion started by: pietie
2 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I wrote a script that reads inputs from user and store in array named "input". The number of elements in the array is not fixed - determined only after user exit the while loop that reads the array values :
x=1
echo "Enter first value"
read input
while } != "exit" ]
do
... (1 Reply)
Discussion started by: luna_soleil
1 Replies
4. Programming
Hi,
In the below C code , i want to pass the array to a unix shel script.
my script should called as ex myscript 1,2,3
#include <stdio.h>
int main()
{
int a={1,2,3};
}
Thanks,
Arun (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
5. Shell Programming and Scripting
Hello,
Can somebody please give me a snippet for the below requirement.
I want to assign the values separeted by a comma to be assigned to a dynamic array.
If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below... (2 Replies)
Discussion started by: suneelj
2 Replies
6. Shell Programming and Scripting
What I am doing is creating a top menu, which a user will select a choice with a number entry. That number corresponds to a string in an array. I then want to assign that response to another array I've already declared.
For example:
#!/bin/bash
colors=(red blue yellow)
red=(cherry fire)... (2 Replies)
Discussion started by: Akilleez
2 Replies
7. Shell Programming and Scripting
I've always written scripts where the user executes the script and I prompt them for what they want to do.
But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice.
What would... (3 Replies)
Discussion started by: ADay2Long
3 Replies
8. Shell Programming and Scripting
I need help parsing the output of find into an array. I need to search 3 directories and find all files older than 31 days old. This is what I have so far.
TIME=" -maxdepth 1 -mtime +31"
DIR1="/dir1/"
DIR2="/dir2/"
DIR3="/dir3/"
FIND_DIR1=$(find ${DIR1}${TIME})
FIND_DIR3=$(find... (8 Replies)
Discussion started by: jrymer
8 Replies
9. Shell Programming and Scripting
Hi folks..
i got a requirement to red multiple directories from STDIN and store them to a variable.
ex:-
echo "Enter directory to add:"
echo " Enter directory to add:"
read value till there is input and when there is no input close the read loop and store variable into an array
... (1 Reply)
Discussion started by: bangaram
1 Replies
10. Shell Programming and Scripting
Hello,
I am running under ubuntu1 14.04 and I have a script which is sending given process names to vanish so that I'd see less output when I run most popular tools like top etc in terminal window. In usual method it works.
Whenever I restart the system, I have to enter the same data from... (2 Replies)
Discussion started by: baris35
2 Replies
LEARN ABOUT DEBIAN
gnutls-cli-debug
gnutls-cli-debug(1) General Commands Manual gnutls-cli-debug(1)
NAME
gnutls-cli-debug - GnuTLS test client, with verbose output
SYNOPSIS
gnutls-cli-debug [options] hostname
DESCRIPTION
Simple client program to set up a TLS connection to some other computer. Like gnutls-cli(1), it sets up a TLS connection and forwards data
from the standard input to the socket. Any information about the TLS control connection is printed to standard error.
OPTIONS
-d, --debug integer
Enable debugging.
-p, --port integer
The port to connect to.
-h, --help
Prints a short reminder of the command line options.
-v, --verbose
Even more verbose output.
SEE ALSO
gnutls-cli(1), gnutls-serv(1)
AUTHOR
Nikos Mavroyanopoulos <nmav@gnutls.org> and others; see /usr/share/doc/gnutls-bin/AUTHORS for a complete list.
This manual page was written by Ivo Timmermans <ivo@debian.org>, for the Debian GNU/Linux system (but may be used by others).
December 1st 2003 gnutls-cli-debug(1)