10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.
The first line of the input consists of an... (1 Reply)
Discussion started by: nishantrefound
2. Shell Programming and Scripting
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
H = (... (2 Replies)
Discussion started by: f77hack
3. Shell Programming and Scripting
I have multiple arrays like below.
set -A val1 1 2 4 5
set -A val2 a b c d
Now i would like to pass the individual arrays one by one to a function and display/ do some action.
Note : I am using ksh
Can you please advise any solution...
Thanks in advance. (7 Replies)
Discussion started by: Girish19
4. Shell Programming and Scripting
Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help.
if == ENDSINFIVEINTS ]]; then
do... (4 Replies)
Discussion started by: briandanielz
5. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
6. Shell Programming and Scripting
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
7. Shell Programming and Scripting
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
find the... (0 Replies)
Discussion started by: jimmy_y
8. Shell Programming and Scripting
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Discussion started by: zeekblack
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
Discussion started by: kmehta
10. Shell Programming and Scripting
I wish to store $string1 in $string1array a character in each array element.
Then i wish to echo the entire array to the screen so that it reads as the normal string again.
I have been trying with the code below but does not work. Please help...
To put string into array:
... (5 Replies)
Discussion started by: rorey_breaker
SURFRAW-UPDATE-PATH(1) User Contributed Perl Documentation SURFRAW-UPDATE-PATH(1)
surfraw-update-path - updates PATH in shell config files
surfraw-update-path [-add] [-remove] [-check] [-sys] [-all] [-help] [-shell=SHELL]
surfraw-update-path adds the surfraw elvi directory (/usr/lib/surfraw) to your PATH in your shell's config file.
Currently it supports bash, sh, csh, tcsh, ash, dash, ksh, pdksh, zsh, rc, and es
Don't forget to login again or source your login files for it to take effect.
Checks to see if the surfraw config code is present. This is the default.
Adds the surfraw config code.
Removes the surfraw config code
Updates the system-wide shell config instead of the user. Must be done as root.
Selects the shell to configure. Defaults to the value of the $SHELL environment variable.
Currently supported shells are:
sh, ash, bash, dash, csh, tcsh, ksh, pdksh, zsh, rc, and es.
Attempts to configure the startup files for all known shells
Gives a usage message
-check returns 0 if the surfraw code is present in the file, 1 if it is not found, or 2 on error.
All other options return 0 on success, or 2 on error.
Used to determine which shell to configure, if -shell is not given.
Used to find users config files.
ENV Used by posix-compliant shells to specify a startup rc file.
Used to find user config files for zsh. If not set, defaults to HOME.
surfraw(1), sh(1), ash(1), bash(1), dash(1), csh(1), tcsh(1), ksh(1), pdksh(1), zsh(1), rc(1), es(1)
Ian Beckwith <email@example.com>
perl v5.12.4 2011-07-12 SURFRAW-UPDATE-PATH(1)