12-03-2010
And store them into an array ?
bash code:
Binary="10101010101010101010101010101010"
for ((i=0; i<${#Binary}; i++)); do
A[$i]=${Binary:$i:1}
done
# to display the values
for i in ${!A[@]} do
echo "$i ${A[$i]}"
done
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hello.,
i have 2 files..
1 file is in this folder
/home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544
(this part)
other file is in this folder
/home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100
... (1 Reply)
Discussion started by: pavan_test
1 Replies
2. UNIX Desktop Questions & Answers
hi all
i am writing the korn shell script.
i have a SQL script which gives me the folowing output
DSA.WLG.20050713211544.20051025.20050713211544 28991 1130198400
DSA.WLG.20050713211544.20051025.20050713211544 25881 1130198400
DSA.WLG.20050711210100.20051025.20050711210100 25881 ... (3 Replies)
Discussion started by: pavan_test
3 Replies
3. AIX
I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies
4. Shell Programming and Scripting
I have to solve some exercises in Korn Shell, but i'm having some problems. For example:
Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written.
I... (3 Replies)
Discussion started by: burm
3 Replies
5. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written.
2. Relevant commands, code,... (3 Replies)
Discussion started by: burm
3 Replies
6. Shell Programming and Scripting
please help me write a perl program to find the difference of 1 and zeros of a 6 digit binary number.
eg If input is 111100 expected output +2
if input is 000011 expected output -2
input is 000111 expected output 0 (2 Replies)
Discussion started by: dll_fpga
2 Replies
7. Shell Programming and Scripting
I have input file like below,
201424|9999|OSS|622010|RGT|00378228764
201424|8888|OM|587079|RGT|00284329675
201424|7777|OM|587076|RGT|00128671024
201424|6666|OM|581528|RGT|00113552084
Output should be like below, should add decimal (.) from last 4 digits.
... (2 Replies)
Discussion started by: vinothsekark
2 Replies
8. Shell Programming and Scripting
Dear Shell script Experts,
I am working on shell script which is defined here, qsub_seq.csh . The purpose of this script is to read few input files (with defined starting index and last index) and make processing faster over server.
For some task, I had 1064 of input files, so I wrote another... (8 Replies)
Discussion started by: emily
8 Replies
9. Programming
Dear Team
We use DB2 v10.5 and using DBArtisan tool
Can someone please guide how to convert digits to binary numbers using db2 feature.
Ex> for number 9 , binary should be 1001 ( 8+1)
Any help appreciated. Thanks (2 Replies)
Discussion started by: Perlbaby
2 Replies
10. UNIX for Beginners Questions & Answers
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Discussion started by: kshitij
4 Replies
sadc(8) BSD System Manager's Manual sadc(8)
NAME
sadc -- system activity data collector
SYNOPSIS
/usr/lib/sa/sadc [-m mode] [t n] [ofile]
DESCRIPTION
The sadc tool is used to collect cumulative system activity data. The sample system data is collected at intervals t seconds apart, in a
loop n times. The binary sample data is written to ofile if specified. Otherwise, the binary data is written to stdout. If the ofile file
does not exist, it is created, otherwise it is truncated.
sadc is intended to be used as the engine behind the sar(1) command, and is not typically invoked on the command line. Two shell scripts,
sa1 and sa2, are provided to drive the typical sampling, saving, and reporting process.
OPTIONS
The following options modify the way data is collected by sadc.
-m mode Modify the collection of system statistics as specified by mode. Currently only one mode is supported.
PPP By default, the collection of ppp network interface statistics is turned off. This is because the number of ppp connec-
tions can be very high, causing the raw data file to grow unexpectedly large, especially when samples are collected at
short intervals. Use the PPP mode to turn the collection back on.
EXAMPLES
/usr/lib/sa/sadc 15 20 /tmp/sample.out
This call collects 20 samples at 15 second intervals. The binary data is written to the /tmp/sample.out file
FILES
/var/log/sa/sadd Default daily activity file that holds the binary sampling data. dd are digits that represent the day of the month.
/usr/lib/sa/sa1 Shell script used to drive the sar data collection.
/usr/lib/sa/sa2 Shell script used to drive the sar data reporting.
SEE ALSO
fs_usage(1), netstat(1), sar(1), sc_usage(1), top(1), vm_stat(1), iostat(8), sa1(8), sa2(8)
Mac OS X Jul 25 2003 Mac OS X