Sponsored Content
Top Forums Shell Programming and Scripting Print String N times the number before it Post 302933550 by fpmurphy on Friday 30th of January 2015 01:53:00 PM
Old 01-30-2015
Here is one way:
Code:
#!/usr/bin/bash

INPUT="20 hello"
set $INPUT

for ((i=0; i < $1; i++))
do
   printf "%s\n"  $2
done

 

10 More Discussions You Might Find Interesting

1. AIX

Number of login times

Hi! I'm currently using AIX 4.3 and would like to know where can i find to see that there's a restriction on the number of login times a user can have. Example, I want to see whether user A has only 1 login while user B can have 2 logins (without logging off the first one). Would I be able to... (7 Replies)
Discussion started by: ftengcheng
7 Replies

2. Shell Programming and Scripting

printing strings in one X number of times from another

I have one file of numbers 4 5 2 ... And another file of strings aaaaa bbbbb ccccc ddddd eeeee ffffff ... I'd like to print the stings from each line in reverse order with some decoration the number of times listed in the first file such as: Yeah bbbbb aaaaa Yeah bbbbb aaaaa (5 Replies)
Discussion started by: dcfargo
5 Replies

3. Shell Programming and Scripting

way to print all the string till we get a space and a number

Is there any way to print all the string till we get a space and a number and store it a variable for eg we have string java.io.IOException: An existing connection was forcibly closed by the remote host 12 All I want is to store "java.io.IOException: An existing connection was forcibly closed... (13 Replies)
Discussion started by: villain41
13 Replies

4. Shell Programming and Scripting

How to print the number of lines from a file, the starting string should be passed`

Hi , I have file, which has the below content: line 100 a b c d line300 a s d f s line200 a s d a (3 Replies)
Discussion started by: little_wonder
3 Replies

5. Shell Programming and Scripting

Print a word specific number of times

Hi All, I wanted to know if there is a shell command to print a word n number of times The Input File is : Cat 4 Bat 3 Zall 1 Kite 2 Output File required is : Cat Cat Cat Cat Bat Bat Bat Zall Kite (4 Replies)
Discussion started by: sam_2921
4 Replies

6. Programming

Find and print number after string in C

I'm trying find and print a number after a specific user passed string in each line of a text file using C (as requested by the powers that be). I've pieced together enough to read the file, find the string and print the line it was found on but I’m not sure where to even start in terms of finding... (3 Replies)
Discussion started by: cgol
3 Replies

7. Shell Programming and Scripting

find string nth occurrence in file and print line number

Hi I have requirement to find nth occurrence in a file and capture data from with in lines (between lines) Data in File. <QUOTE> <SESSION> <ATTRIBUTE NAME='Parameter Filename' VALUE='file1.parm'/> <ATTRIBUTE NAME='Service Name' VALUE='None'/> </SESSION> <SESSION> <ATTRIBUTE... (6 Replies)
Discussion started by: tmalik79
6 Replies

8. Shell Programming and Scripting

Print each column 3 times

Hi All, I have a file with more than 2000 columns and I would like to print each column 3 times, so that I will get a file like col1 col1 col1 col2 col2 col2 ........coln coln coln. I have tried the following code: awk '{for(i=1; i<=NF; i++) {s=s FS $i,$i,$i} print s;s=""}' input >... (2 Replies)
Discussion started by: Fredrick
2 Replies

9. Shell Programming and Scripting

How to print a particular character n number of times in a line??

hi, Is it possible to print a particular character n number of times in a line? for example. i am print the following line using echo command.. echo "files successfully moved" i want to count the number of characters that are been displayed. i am doin it using echo "files... (8 Replies)
Discussion started by: Little
8 Replies

10. UNIX for Beginners Questions & Answers

Print number of lines for files in directory, also print number of unique lines

I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with: wc -l *|sort 15263 Image.txt 16401 reference.txt 40459 richtexteditor.txt How can I also print the number of unique lines in each file? 15263 1401 Image.txt 16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
SOAPCPP2(1)						      General Commands Manual						       SOAPCPP2(1)

NAME
soapcpp2 - the gSOAP Stub and Skeleton Compiler for C and C++ SYNOPSIS
soapcpp2 [OPTIONS] INPUT DESCRIPTION
Please see /usr/share/doc/gsoap/soapdoc2.html for details. Create stubs and client and server code from input INPUT or standard input if INPUT is not specified. OPTIONS
-1 Generate SOAP 1.1 bindings. -2 Generate SOAP 1.2 bindings. -C Generate client-side code only. -S Generate server-side code only. -T Generate server-side auto-test code. -L Do not generate soapClientLib/soapServerLib. -a Use SOAPAction HTTP/WSA header to invoke server-side operations. -b Serialize byte arrays char[N] as string. -c Generate C source code. -dpath Use path to save files. -e Generate SOAP RPC encoding style bindings. -fN File split of N XML serializer implementations per file (N>=10). -h Display help info. -Ipath use path(s) for #import. -i Generate C++ service proxies and objects inherited from soap struct. -j Generate C++ service proxies and objects that share a soap struct. -k Generate data structure walkers (experimental). -l Generate linkable modules (experimental). -m Generate Matlab(tm) code for MEX compiler. -n Use service name to rename service functions and namespace table. -pname Save files with new prefix name instead of soap. -qname Use name as the C++ namespace of all declarations. -s Generate deserialization code with strict XML validation checks. -t Generate code for fully xsi:type typed SOAP/XML messaging. -u Uncomment comments in WSDL/schema output by suppressing XML comments. -v Display version info. -w Do not generate WSDL and schema files. -x Do not generate sample XML message files. -y Include C/C++ type access information in sample XML messages. SEE ALSO
wsdl2h(1). AUTHOR
This manual page was written by Thomas Wana <greuff@debian.org>, for the Debian project (but may be used by others). Juni 27, 2003 SOAPCPP2(1)
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy