I'd say I'm having this weird problem where my script isn't taking the value off a variable or printing it. My code is like this:
Code:
set count_C= `grep -c C mols`
set count_H= `grep -c H mols`
set count_O= `grep -c O mols`
sed -i '7,7 s/$/ $count_C $count_O $count_H/g' input
It doesn't work. It prints $count_C instead of the value. I've tried various ways, even echo $count_C doesn't return my value. I tried
Code:
count_C= $(grep -c C mols)
and also this:
Code:
set count_C= $(grep -c C mols)
but with no result.
Strange thing is I tried the following in the terminal instead of my script and it worked,
Code:
set count_C= `grep -c C mols`
echo $count_C
But the same thing doesn't work in my script.Instead of echoing, it only shows a blank space. In the end I'd like to know how I would use my variables in sed to insert that value in a specific line.
Thanks a lot!
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OSX
base32core
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)