I am trying to assign the contents of file e.g
ls "$HOME"
into an array. If it is possible then please guide me without using the concept of awk,sed, and perl16
Thanks (10 Replies)
Greetings folks,
I am trying to assign the output of a dscl command (contains name<spaces>id) to a variable as an array. Currently I am piping the output into a tmp file, then reading the tmp file into an array, then parsing the array. I would like to bypass creating the tmp file portion of... (6 Replies)
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Hi,
I have a piece of code as follows:
i=0
while read LINE
do
var = "$LINE"
i=$((i+1))
echo "${var}"
done < file
I want to assign value to the array var.
However, when i execute the script i get a error.
Please can you help me know what i am missing.
I ultimately want to... (2 Replies)
Hi every one.. I'm new to shell scripting... I would like to assign a single array element to a variable... Is it possible to do it....
Could any body help me.... (3 Replies)
Hi all ,
I have a string like para1#para2#para3
i want to assign para1 as first element para2 as second and so on
i tried
IFS=#
set -A array para1#para2#para3
echo ${array}
para1 para2 para3
i want echo ${array}
para1 (2 Replies)
I wish to assign file names with particular extention to array variables. For example if there are 5 files with .dat extention in /home/sam then i have to assign these 5 files to an array.
plz help me how to accomplish this.
Thanks in advance. (4 Replies)
is it possible to assign value to an array variable from an external file?? if yes then how??
I am using below code but its not working.
#!bin/bash
myarray < file_name
echo ${mayarray} (6 Replies)
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
LEARN ABOUT LINUX
shasum
SHASUM(1) Perl Programmers Reference Guide SHASUM(1)NAME
shasum - Print or Check SHA Checksums
SYNOPSIS
Usage: shasum [OPTION] [FILE]...
or: shasum [OPTION] --check [FILE]
Print or check SHA checksums.
With no FILE, or when FILE is -, read standard input.
-a, --algorithm 1 (default), 224, 256, 384, 512
-b, --binary read files in binary mode (default on DOS/Windows)
-c, --check check SHA sums against given list
-p, --portable read files in portable mode
produces same digest on Windows/Unix/Mac
-t, --text read files in text mode (default)
The following two options are useful only when verifying checksums:
-s, --status don't output anything, status code shows success
-w, --warn warn about improperly formatted SHA checksum lines
-h, --help display this help and exit
-v, --version output version information and exit
The sums are computed as described in FIPS PUB 180-2. When checking,
the input should be a former output of this program. The default mode
is to print a line with checksum, a character indicating type (`*'
for binary, `?' for portable, ` ' for text), and name for each FILE.
DESCRIPTION
The shasum script provides the easiest and most convenient way to compute SHA message digests. Rather than writing a program, the user
simply feeds data to the script via the command line, and waits for the results to be printed on standard output. Data can be fed to
shasum through files, standard input, or both.
The following command shows how easy it is to compute digests for typical inputs such as the NIST test vector "abc":
perl -e "print qw(abc)" | shasum
Or, if you want to use SHA-256 instead of the default SHA-1, simply say:
perl -e "print qw(abc)" | shasum -a 256
Since shasum uses the same interface employed by the familiar sha1sum program (and its somewhat outmoded anscestor md5sum), you can install
this script as a convenient drop-in replacement.
AUTHOR
Copyright (c) 2003-2008 Mark Shelor <mshelor@cpan.org>.
SEE ALSO
shasum is implemented using the Perl module Digest::SHA or Digest::SHA::PurePerl.
perl v5.12.4 2013-03-18 SHASUM(1)