Sponsored Content
Top Forums Shell Programming and Scripting Echo "${array[@]}" with specified delimiter Post 302784229 by Michael Stora on Thursday 21st of March 2013 08:02:53 PM
Old 03-21-2013
Code:
$ array=(1 2 3 4 5 6 7 8 9 10)
$ echo ${array[@]}
1 2 3 4 5 6 7 8 9 10 but want 1,2,3,4,5,6,7,8,9,10

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

2. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

3. Programming

C: Initialize "const" array from the "heap"

Hello, I am working on solving an NP-Complete problem, so it is very important that operations and data with limited integer-argument ranges be computed using immutable look-up-tables contained entirely in CPU cache. Retrieval of the look-up-table data must never leave the CPU once initially... (6 Replies)
Discussion started by: HeavyJ
6 Replies

4. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. AIX

echo $varibla | mail -s "subject" "xxx@xxx.com" not ruuning as expected

Hi Folks, As per the subject, the following command is not working as expected. echo $variable | mail -s "subject" "xxx@xxx.com" Could anyone figure it out whats wrong with this. I am using AIX box. Regards, (2 Replies)
Discussion started by: gjarms
2 Replies

7. Shell Programming and Scripting

Substituting comma "," for dot "." in a specific column when comma"," is a delimiter

Hi, I'm dealing with an issue and losing a lot of hours figuring out how i would solve this. I have an input file which looks like this: ('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos') ('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies

8. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
tput(1) 						      General Commands Manual							   tput(1)

NAME
tput - query terminfo database SYNOPSIS
type] capname... type] capname [parms...] DESCRIPTION
The command uses the database to make terminal-dependent capabilities and information available to the shell (see terminfo(4)). The com- mand outputs a string if the attribute (capname) is of type string, or an integer if the attribute is of type integer. If the attribute is of type boolean, simply sets the exit code for TRUE, for FALSE), and produces no output. Command-line Arguments The command recognizes the following command-line arguments: Indicates the type of terminal. Normally this flag is unnecessary because the default is taken from the environment variable capname Indicates the attribute from the database. See terminfo(4). In addition, the following capnames are supported: Echo the clear-screen sequence for the current terminal. Echo the initialize sequence for the current terminal. Echo the sequence that will reset the current terminal. parms If the capname takes optional numeric parameters, the parms will be placed in the string output by The capnames are read from stdin and multiple capnames are allowed. Only one capname is allowed per line when reading from stdin. EXTERNAL INFLUENCES
Environment Variables determines the locale to use. This overrides settings of other environment variables. determines the language to use for messages. determines the terminal type if the option is not specified. EXAMPLES
Echo clear-screen sequence for the current terminal. Print the number of columns for the current terminal. Print the number of columns for the 70092 terminal. Set shell variable to stand-out-mode sequence for current terminal. This might be followed by a prompt: Set exit code to indicate if current terminal is a hard copy terminal. Clear the screen, move the cursor to line 10, column 20 and turn on bold. RETURN VALUE
If capname is of type boolean, then the exit code is set to for true and for false. If capname is not of type boolean and fails, an error message is printed, and exit code is set to one of the following depending on the failure: The capability name is of type integer and does not exist. Usage error. Unknown terminal type. Unknown capability name. An error occurred. If the exit code is a is printed if a capability name of type integer is requested for a terminal that has no entry for that capability name in the database (such as FILES
Terminfo data base Definition files SEE ALSO stty(1), untic(1M), terminfo(4). STANDARDS CONFORMANCE
tput(1)
All times are GMT -4. The time now is 07:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy