Sponsored Content
Full Discussion: Defining variable problem
Top Forums UNIX for Dummies Questions & Answers Defining variable problem Post 302909141 by itkamaraj on Monday 14th of July 2014 11:54:35 PM
Old 07-15-2014
Code:
#!/bin/bash
count_C=$(grep -c C mols)
count_H=$(grep -c H mols)
count_O=$(grep -c O mols)
value="${count_C} ${count_O} ${count_H}"
awk -v value="$value" 'NR==7{$0=$0" "value}1' input

This User Gave Thanks to itkamaraj For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

defining a variable as a number or character?

I am writing a script that needs to accept numbers into a variable by prompting and using the code read num case $num in 000) break ;; *) I am fairly new to unix and am loving the versatility of the language but need a little shove in the right... (1 Reply)
Discussion started by: noobian
1 Replies

2. UNIX for Dummies Questions & Answers

Defining Variables

I'm trying to define a variable named sin I already have a variable named cos, which has the value "hello" I want sin to have the value of "hellothere", so sin would be something like sin = $cos & "there" but I'm not sure that I know the syntax. Can anyone help? :confused: (4 Replies)
Discussion started by: sailorliones
4 Replies

3. Shell Programming and Scripting

Sorting/Filed Defining/Output problem

need a little help with a few tid bits. I wrote a script that checks the resoluion of image files and writes them out to a file then sorts the resolutions by largets Width. Then take the sorted files information and toss all the 835 widths into a seperate file. Ignore the redundancies its a... (1 Reply)
Discussion started by: TiredOrangeCat
1 Replies

4. Solaris

Problem defining remote printers on solaris 10

Good morning, I have a server with solaris 10 that I want to intall remote printers. I started lpsched deamon without problems with command: svcadm enable application/print/server I want to install printers that are defined locally on print server, so: lpadmin -p <device> -s <print... (2 Replies)
Discussion started by: bonovox
2 Replies

5. UNIX for Dummies Questions & Answers

Defining EDITOR Variable - Tru64

Hi, I have to edit a lot of partitions soon and wanted to do so with EMACS rather than VI. The "disklabel -e -r disknumber" command picks up VI as it's defined, but how do I set "-e" so it uses EMACS instead please? Thanks...! (2 Replies)
Discussion started by: Bagel08
2 Replies

6. Shell Programming and Scripting

defining variables

Hey all, I was wondering if someone would take a look at this script I'm working on. I don't know if i have the syntax correct for my variables and if the for loop is written correctly. any assistance would be greatly appreciated. #!/usr/bin/bash ###########################################... (12 Replies)
Discussion started by: em23
12 Replies

7. Shell Programming and Scripting

defining a variable using multiple "entries/columns" within a line using read

Hello All, I am trying to figure out how to use the read command. I have a txt file that has rows looking something like this: 1 2 3 4 5 6 7 8 9 where each number represents an entry of various characters deliminated by tabs. My goal is to set entries 2-7 as a variable/string that I... (3 Replies)
Discussion started by: Torinator
3 Replies

8. Shell Programming and Scripting

alias defining problem in .cshrc file

Hi folks, I'm trying to define the following command as alias in .cshrc file: ls -ltr | grep ^d | awk '{print $9}' | xargs du -hs I defined it as the following: alias nirdirs '`ls -ltr | grep "^d" | awk "{print \\$9}" | xargs du -hs`' I've got the following error when I've run the alias:... (7 Replies)
Discussion started by: nir_s
7 Replies

9. UNIX for Dummies Questions & Answers

defining variable in .profile

In root dir i have created a .profile file and added variable and assigned a path to it: a = '/dir/dir' export a but when i echo (echo $a) the path or use this variable the value or path not getting displayed. i tried executing the .profile and logging out and logging in, didnt workout. am... (1 Reply)
Discussion started by: abhi_n123
1 Replies

10. Programming

Problem defining a struct

I have the following code and getting the compilation errors baseLib/DynBaseObj.h:80: error: expected constructor, destructor, or type conversion before ‘(' token baseLib/DynBaseObj.h:89: error: expected constructor, destructor, or type conversion before ‘(' token baseLib/DynBaseObj.h:101:... (0 Replies)
Discussion started by: kristinu
0 Replies
base32::core(n) 						  Base32 encoding						   base32::core(n)

__________________________________________________________________________________________________________________________________________________

NAME
base32::core - Expanding basic base32 maps SYNOPSIS
package require Tcl 8.4 package require base32::core ?0.1? ::base32::core::define map forwvar backwvar ivar ::base32::core::valid string pattern mvar _________________________________________________________________ DESCRIPTION
This package provides generic commands for the construction of full base32 mappings from a basic mapping listing just the codes and associ- ated characters. The full mappings, regular and inverse, created here map to and from bit sequences, and also handle the partial mappings at the end of a string. This is in essence an internal package to be used by implementors of a base32 en- and decoder. A regular user has no need of this package at all. API
::base32::core::define map forwvar backwvar ivar This command computes full forward and backward (inverse) mappings from the basic map and stores them in the variables named by for- wvar and backwvar resp. It also constructs a regexp pattern for the detection of invalid characters in supposedly base32 encoded input and stores it in the variable named by ivar. ::base32::core::valid string pattern mvar This command checks if the input string is a valid base32 encoded string, based on the pattern of invalid characters as generated by ::base32::core::define, and some other general rules. The result of the command is a boolean flag. Its value is True for a valid string, and False otherwise. In the latter case an error message describing the problem with the input is stored into the variable named by mvar. The variable is not touched if the input was found to be valid. The rules checked by the command, beyond rejection of bad characters, are: [1] The length of the input is not a multiple of eight, [2] The padding appears not at the end of input, but in the middle, [3] The padding has not of length six, four, three, or one characters, BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base32 of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
base32 CATEGORY
Text processing COPYRIGHT
Copyright (c) Public domain base32 0.1 base32::core(n)
All times are GMT -4. The time now is 08:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy