Sponsored Content
Full Discussion: output a particular string
Top Forums Shell Programming and Scripting output a particular string Post 302268664 by manikantants on Tuesday 16th of December 2008 05:24:01 AM
Old 12-16-2008
-F: --> This declares ":" as the field separator
MSI comes in the 4th word.
If first 3 char of 4th word is "MSI"
print 5th char onwards of 4th word
else
If first word is "Resp" and second word is > 0
print "none"
end if
end if
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extraction of the output from a string.

Hi Everyone, I stored the result of a certain awk script in the variable arr.The result is /inets /banking /tools. arr= /inets /banking /tools These are 3 direcctories. I should be able to move in to these directories using "cd" command.Can you tell me how to extract... (5 Replies)
Discussion started by: saicharantej
5 Replies

2. Shell Programming and Scripting

input string="3MMTQSZ348GGMZRQWMJM4SD6M";output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6

input string="3MMTQSZ348GGMZRQWMJM4SD6M" output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6M" using linux shell script (4 Replies)
Discussion started by: pankajd
4 Replies

3. Shell Programming and Scripting

how to find a particular string from a set of string output

Hi , I have a line by line output as follows,for example output of ls sample1 sample2 sample i need to check if this output contains the exact string sample.If i use grep , it will find out all strings that contain sample as a part of their word.I dont want to do a pattern matching... (11 Replies)
Discussion started by: padmisri
11 Replies

4. Shell Programming and Scripting

Convert output to string

Hi Guys, is there any command to convert the output returned by the below command to string format: Code: sed 1!d filename Output is : 108 ---------- Post updated at 11:03 AM ---------- Previous update was at 11:00 AM ---------- Because i am using this output as string parameter ... (4 Replies)
Discussion started by: kam786sim
4 Replies

5. Shell Programming and Scripting

Extracting particular string in a file and storing matched string in output file

Hi , I have input file and i want to extract below strings <msisdn xmlns="">0492001956</ msisdn> => numaber inside brackets <resCode>3000</resCode> => 3000 needs to be extracted <resMessage>Request time getBalances_PSM.c(37): d out</resMessage></ns2:getBalancesResponse> => the word... (14 Replies)
Discussion started by: sushmab82
14 Replies

6. Shell Programming and Scripting

awk: round output or delimit output of arithmatic string

I have a file with the following content. > cat /tmp/internetusage.txt 6709.296322 30000 2/7/2010 0.00I am using the following awk command to calculate a percentage from field 1 and 2 from the file. awk '{ print $1/$2*100 }' /tmp/internetusage.txt This outputs the value "22.3643" as a... (1 Reply)
Discussion started by: jelloir
1 Replies

7. Shell Programming and Scripting

format string output

I need to put the output of the ps -ef command into a string. echo'n that string must display the output similiar to how we see the output of ps -ef in commandline. This is the string message="this is the output of ps command\n\n `ps -ef`\n\n Output Complete" when I echo $message the... (11 Replies)
Discussion started by: Northpole
11 Replies

8. Shell Programming and Scripting

script that answers y unless output has a string "STRING" in it

Hi all, I have the following script which I use to chek the output of jobs submitted to a PBS server. #!/bin/sh # #recover.sh # check() { echo "Do you want to proceed?" read answer if ; then echo "... proceeding ..." else echo "--------- Aborting -----------"... (0 Replies)
Discussion started by: faizlo
0 Replies

9. Shell Programming and Scripting

Extract string from output.

I need to extract the the values of "Java"and "-Dplatform.home" from the output of the below ps command. ps -xef | grep java wlsuser 15160 15144 0 Feb 20 ? 17:27 /app1/jdk150_07/bin/IA64N/java -server -Xms1536m -Dplatform.home=/app1/bea/weblogic92... (8 Replies)
Discussion started by: mohtashims
8 Replies

10. Shell Programming and Scripting

Grep for string and then output...

Hi all, I have a file: /var/log/lct/buildinformation I am trying to grep for string: MANUFACTURER : VMware, Inc. If it contains the string I want to output the results of:df -h |grep '/usr|/var' |awk '{print $6 " "$5}' If it does not have the above string to send a no vm found... (6 Replies)
Discussion started by: gartie
6 Replies
JOT(1)							      General Commands Manual							    JOT(1)

NAME
jot - print sequential or random data SYNOPSIS
jot [ options ] [ reps [ begin [ end [ s ] ] ] ] DESCRIPTION
Jot is used to print out increasing, decreasing, random, or redundant data, usually numbers, one per line. The options are understood as follows. -r Generate random data instead of sequential data, the default. -b word Just print word repetitively. -w word Print word with the generated data appended to it. Octal, hexadecimal, exponential, ASCII, zero padded, and right-adjusted repre- sentations are possible by using the appropriate printf(3) conversion specification inside word, in which case the data are inserted rather than appended. -c This is an abbreviation for -w %c. -s string Print data separated by string. Normally, newlines separate data. -n Do not print the final newline normally appended to the output. -p precision Print only as many digits or characters of the data as indicated by the integer precision. In the absence of -p, the precision is the greater of the precisions of begin and end. The -p option is overridden by whatever appears in a printf(3) conversion following -w. The last four arguments indicate, respectively, the number of data, the lower bound, the upper bound, and the step size or, for random data, the seed. While at least one of them must appear, any of the other three may be omitted, and will be considered as such if given as -. Any three of these arguments determines the fourth. If four are specified and the given and computed values of reps conflict, the lower value is used. If fewer than three are specified, defaults are assigned left to right, except for s, which assumes its default unless both begin and end are given. Defaults for the four arguments are, respectively, 100, 1, 100, and 1, except that when random data are requested, s defaults to a seed depending upon the time of day. Reps is expected to be an unsigned integer, and if given as zero is taken to be infinite. Begin and end may be given as real numbers or as characters representing the corresponding value in ASCII. The last argument must be a real number. Random numbers are obtained through random(3). The name jot derives in part from iota, a function in APL. EXAMPLES
The command jot 21 -1 1.00 prints 21 evenly spaced numbers increasing from -1 to 1. The ASCII character set is generated with jot -c 128 0 and the strings xaa through xaz with jot -w xa%c 26 a while 20 random 8-letter strings are produced with jot -r -c 160 a z | rs -g 0 8 Infinitely many yes's may be obtained through jot -b yes 0 and thirty ed(1) substitution commands applying to lines 2, 7, 12, etc. is the result of jot -w %ds/old/new/ 30 2 - 5 The stuttering sequence 9, 9, 8, 8, 7, etc. can be produced by suitable choice of precision and step size, as in jot 0 9 - -.5 and a file containing exactly 1024 bytes is created with jot -b x 512 > block Finally, to set tabs four spaces apart starting from column 10 and ending in column 132, use expand -`jot -s, - 10 132 4` and to print all lines 80 characters or longer, grep `jot -s "" -b . 80` SEE ALSO
ed(1), expand(1), rs(1), yes(1), printf(3), random(3), expand(1) 4th Berkeley Distribution June 6, 1993 JOT(1)
All times are GMT -4. The time now is 08:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy