Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need to pass variable in a command and assign value to a variable Post 302999799 by RudiC on Wednesday 28th of June 2017 06:00:07 AM
Old 06-28-2017
Neither of my questions has been answered, none of my suggestions was applied, helpful info was not supplied. Instead of focusing on one problem (specified in the first post), you are broadening the operating field and introduce new errors. In your last post, there are at least two syntactical errors: spaces around the equals signs when assigning shell variables, and single quotes around the variables preventing them from being expanded. No surprise it doesn't do what you expect.
Unless you supply info enabling people to help you, I'm afraid I can't help further.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign awk command result to a variable

#!/bin/sh # ## MYSTRING = `awk '/myApp.app/' /Users/$USER/Library/Preferences/loginwindow.plist` if then echo String not found defaults write /Users/$USER/Library/Preferences/loginwindow AutoLaunchedApplicationDictionary -dict-add -string Hide -bool YES -string Path -string... (9 Replies)
Discussion started by: dedmakar
9 Replies

2. Shell Programming and Scripting

Assign bash command to variable

Hi I am trying to write a function that needs to be able to assign the last run shell command to a variable. The actual command string itself not the exit code of the command. I am using the bash command recall ability to do this as follows: alias pb='ps | grep ash' ... (3 Replies)
Discussion started by: Moxy
3 Replies

3. UNIX for Dummies Questions & Answers

Cut Command value assign to variable

Hi, I am new to UNIX Scripting. I have been trying to use the CUT command to retrieve part of the header from a file and assign it to a variable. I have tried searching a lot, but I am still unsuccessful. Sample Header: HJAN BALANCE 20090616 I need to retrieve the date here, which always... (10 Replies)
Discussion started by: ragz_82
10 Replies

4. Shell Programming and Scripting

Assign command (with pipe) output to a variable

Hi , I would like to assign command (with pipe) output to a variable. The code is as follows. The goal of the code is to get the last folder folder with a particular name pattern. myDate=`ls | grep 2009 | tail -1` echo "myDate=" $myDate However, in the presence of the pipe, the code... (3 Replies)
Discussion started by: jeff_cen
3 Replies

5. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

6. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

7. Shell Programming and Scripting

Unable to assign command output to variable

Code set -x STATUS="0" echo $STATUS for i in `ls -ltr Report*|awk '{ print $9 }'` do if then flg = "`head -1 "$i" |cut -c 31-33`" echo `head -1 "$i" |cut -c 31-33` echo $flg if then echo "having Fun" STATUS="2" else echo "no Fun" fi fi (2 Replies)
Discussion started by: Funkeydude
2 Replies

8. Shell Programming and Scripting

Assign the result of a multiline command to a variable

Hi, I have the following command that lists all the .o files from all the directories except of vwin (which I don't want it) for i in `ls -d */*.o|awk '$0 !~ "vwin"'`; do echo $i; done The result is something like that dir1/file1.o dir1/file2.o dir2/file3.o etc. So, I want to create a... (9 Replies)
Discussion started by: scor6800
9 Replies

9. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies

10. UNIX for Beginners Questions & Answers

Assign a command to a variable - Help

Hi, I have the script below. When i assign SSH_COMMAND to "ssh -o ConnectTimeout=2 ${SERVER} ${AS_SUDO} ${COMMANDS}" and then execute it as ${SSH_COMMAND} I get the following error: ssh: Could not resolve hostname sudo: Name or service not known ssh: Could not resolve hostname sudo: Name or... (3 Replies)
Discussion started by: mohca2020
3 Replies
INSTALLDEB-WORDLIST(1)													    INSTALLDEB-WORDLIST(1)

NAME
installdeb-wordlist - debhelper-like utility for maintainers of wordlist Debian packages SYNOPSIS
installdeb-wordlist [debhelper options] [options] DESCRIPTION
installdeb-wordlist is a debhelper like program that is responsible for installing appropriate debconf config and templates files and debhelper snippets in a wordlist package, according to the Debian Spell Dictionaries and Tools Policy. For more details, see /usr/share/doc/dictionaries-common-dev/dsdt-policy.txt.gz The actions executed by installdeb-wordlist are the following: o Maintainer Scripts installdeb-wordlist installs the necessary scraps of code in the postinst and postrm scripts. o Language info file installdeb-wordlist also checks a file containing wordlist information, called debian/info-wordlist or debian/package.info-wordlist. If this file is successfully parsed, it is installed in the /var/lib/dictionaries-common/wordlist directory. o Debconf files o templates and config files installdeb-wordlist installs the Policy compliant Debconf files from the information contained in the info-wordlist file. These files are created as debian/config (or debian/package.config) and debian/templates (or debian/package.templates). No intervention is needed here, since installdeb-wordlist will make a call to dh_installdebconf(1). If the package needs to have special code in the config file, the maintainer should supply files called debian/config.in (or debian/package.config.in). In the config.in file, the string "#DEBHELPER#" must appear alone in one line and start at the first column. installdeb-wordlist will replace that token with the necessary Policy compliant code (this works with config.in is either a Bourne shell or Perl script). If the package needs to define its own questions via the templates file the maintainer should either supply files debian/po-master.templates (or debian/package.po-master.templates) together with the appropriate po files if the package handles template localization through po-debconf, or debian/templates.in (or debian/package.templates.in) otherwise. See the po-debconf(7) manual page for more details and remember that the master templates name is now different. The templates defined in the templates.in or po-master.templates files are merged into the Policy compliant templates by installdeb-wordlist and a call to dh_installdebconf(1) is internally done. o The elanguages template field This field is useful if you want to override the debconf languages string with something different (since the master string remains the same, this will not trigger a new debconf call) or if you really think that the languages string should be internationalized for your package. Note that for most packages the poor man default localization should be enough, and translators should have another priorities. installdeb-wordlist default behavior is not adding an "elanguages" field to the templates file. If you want it added you have to call the script with the explicit --write-elanguages option. This field will be added with value taken from the "Elanguage" entry in the info file if present, or after the "Language" value otherwise. Note that this is useful only if: - You want to fix a buggy entry In this case just fill the "Elanguage" field in the info file with the new value. This will be shown at the debconf prompt. - You want to fully internationalize your entries In this case some black magic is needed at first time for smooth use, (a) Run installdeb-{ispell,wordlist} --no-installdebconf --write-elanguages for every package whose string should be internationalized. Edit the created .templates files and remove the leading underscores in the elanguages entry if present. (b) Run debconf-gettextize templates_to_be_internationalized. Check that all the desired .templates files are in debian/po/POTFILES.in and remove old .config and .templates files. (c) Run again installdeb-{ispell,wordlist} --no-installdebconf --write-elanguages and debconf-updatepo (no edit here) to remove references to non-translatable strings. Check that the desired strings are in the po master file (debian/po/templates.pot) and remove .config and .templates files. You are done. If the master "Elanguages" string is changed, repeat (c) afterward. OPTIONS
The usual dephelper(1) options are accepted. Options below are specific to installdeb-wordlist --no-installdebconf Do not run dh_installdebconf nor remove templates and config file. --no-pre-post Do not install {pre,post}{inst,rm} snippets. --write-elanguages Create the elanguages stuff. --debug Show some extra info. NOTES
This program is not part of debhelper, although it is intended to be used in wordlist packages using debhelper in its building. SEE ALSO
debhelper(1) This program is part of the dictionaries-common-dev package. It is intended to be used by maintainers of wordlist packages for Debian. See the documentation under /usr/share/doc/dictionaries-common-dev. AUTHORS
Rafael Laboissiere, Agustin Martin 1.12.11 2013-1-22 INSTALLDEB-WORDLIST(1)
All times are GMT -4. The time now is 10:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy