Sponsored Content
Top Forums Shell Programming and Scripting [QUESTION] echoing a variable Post 302731643 by Ryuinferno on Thursday 15th of November 2012 01:09:49 PM
Old 11-15-2012
Quote:
Originally Posted by Corona688
Ah, use single quotes. '$mmc' and it will not substitute.

I don't know why you'd want that, as $mmc in a text file isn't really useful. It will be very difficult to turn it back into a variable later.
Cause I am actually trying to tell the script to create another script...Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

echoing two variables in one statement

I have the following -------------------- foreach var (STO SNY WKF) set ta = 5 end --------- How can I echo both variables at the same time. Something to the effect of echo ${$var}ta But this doesn't work. Seems like it would. Thanks. (4 Replies)
Discussion started by: wxornot
4 Replies

2. UNIX for Dummies Questions & Answers

echo not echoing correctly

Here is the file named tuwork.......... 209 200 WZ 6529 SKTNCA01X4X C POI LODI LODI 738 SKTNCA0127T LOD Here is the scipt....... cat tuwork | while read rva do num=`echo $rva | cut -d" " -f1-2` reg=`echo $rva | cut -c10` ocn=`echo $rva | cut -c12-15` x=`echo $rva | cut -c29`... (3 Replies)
Discussion started by: shorty
3 Replies

3. Shell Programming and Scripting

Echoing

I was just wondering how you would echo out different length variables but still have them all line up. I tried putting tabs between the variables but that didn't work as planned. For example this is in some loop, with different variables in it each time: echo "$1 $2 $3 $4 $5" Appears like... (3 Replies)
Discussion started by: Okema
3 Replies

4. Shell Programming and Scripting

Echoing weird variables.

kindly find below:- var="'(]\\{}\$\"" echo $var # it wil give this '(]\{}$" echo "$var" # '(]\{}$" Doesn't make a difference why???. if we set IFS to '\' also the below happens IFS='\' echo $var # '(] {}$" \ converted to space. Why? weird!! echo "$var"... (3 Replies)
Discussion started by: ahmad.diab
3 Replies

5. Shell Programming and Scripting

echoing date command into file

I want to echo into file1 echo & date commands, which in turn will be echoed into file2 string and the current date. So when I'll run file1 it will echo into file2 the commands 'echo' & 'date' My problem is that the date command turns into the actual date value. Example:... (2 Replies)
Discussion started by: liav
2 Replies

6. Shell Programming and Scripting

Variable to command to Variable Question KSH

Hello, First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID,... (3 Replies)
Discussion started by: Coyote270WSM
3 Replies

7. Shell Programming and Scripting

Echoing command results

Sorry folks, Second time today. I am working on a script that accepts data via pipe and processes it. I expect it to work as: # command | ProcScript.sh Within ProcScript.sh, I want to be able to give the target of the prev run command I am using history 2 | grep -v history | awk... (18 Replies)
Discussion started by: Marc G
18 Replies

8. Shell Programming and Scripting

Echoing silently?

I know, sounds mutually exclusive :-) I have a script where I ask for a password and store it in a variable, and then use it with sudo on an array of other hosts. The password winds up being choed back to my terminal as well as to the process on the remote host, like: Attempting to update... (2 Replies)
Discussion started by: jnojr
2 Replies

9. Shell Programming and Scripting

Echoing only once for each subdir

I have a script that runs from this: for i in * ; do (cd $i && echo $i && /test1/execute/testb);done this is testb: for file in `ls *.txt` do if && && && && && ; then echo "NO"; break 1; else echo "it is there" fi done What is happening is that I can get it to run a... (19 Replies)
Discussion started by: newbie2010
19 Replies

10. UNIX for Beginners Questions & Answers

Getopts not echoing correctly

Hi, When I run the the following code: #!/bin/bash if ]; then usage fi if ] then echo "Do not execute this as root, use -s instead" fi SERVERFILE="servers" function usage { echo "USAGE: ${0} COMMAND" (4 Replies)
Discussion started by: mohca2020
4 Replies
PRIO(8) 							       Linux								   PRIO(8)

NAME
PRIO - Priority qdisc SYNOPSIS
tc qdisc ... dev dev ( parent classid | root) [ handle major: ] prio [ bands bands ] [ priomap band band band... ] [ estimator interval timeconstant ] DESCRIPTION
The PRIO qdisc is a simple classful queueing discipline that contains an arbitrary number of classes of differing priority. The classes are dequeued in numerical descending order of priority. PRIO is a scheduler and never delays packets - it is a work-conserving qdisc, though the qdiscs contained in the classes may not be. Very useful for lowering latency when there is no need for slowing down traffic. ALGORITHM
On creation with 'tc qdisc add', a fixed number of bands is created. Each band is a class, although is not possible to add classes with 'tc qdisc add', the number of bands to be created must instead be specified on the command line attaching PRIO to its root. When dequeueing, band 0 is tried first and only if it did not deliver a packet does PRIO try band 1, and so onwards. Maximum reliability packets should therefore go to band 0, minimum delay to band 1 and the rest to band 2. As the PRIO qdisc itself will have minor number 0, band 0 is actually major:1, band 1 is major:2, etc. For major, substitute the major num- ber assigned to the qdisc on 'tc qdisc add' with the handle parameter. CLASSIFICATION
Three methods are available to PRIO to determine in which band a packet will be enqueued. From userspace A process with sufficient privileges can encode the destination class directly with SO_PRIORITY, see socket(7). with a tc filter A tc filter attached to the root qdisc can point traffic directly to a class with the priomap Based on the packet priority, which in turn is derived from the Type of Service assigned to the packet. Only the priomap is specific to this qdisc. QDISC PARAMETERS
bands Number of bands. If changed from the default of 3, priomap must be updated as well. priomap The priomap maps the priority of a packet to a class. The priority can either be set directly from userspace, or be derived from the Type of Service of the packet. Determines how packet priorities, as assigned by the kernel, map to bands. Mapping occurs based on the TOS octet of the packet, which looks like this: 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ | | | | |PRECEDENCE | TOS |MBZ| | | | | +---+---+---+---+---+---+---+---+ The four TOS bits (the 'TOS field') are defined as: Binary Decimal Meaning ----------------------------------------- 1000 8 Minimize delay (md) 0100 4 Maximize throughput (mt) 0010 2 Maximize reliability (mr) 0001 1 Minimize monetary cost (mmc) 0000 0 Normal Service As there is 1 bit to the right of these four bits, the actual value of the TOS field is double the value of the TOS bits. Tcpdump -v -v shows you the value of the entire TOS field, not just the four bits. It is the value you see in the first column of this table: TOS Bits Means Linux Priority Band ------------------------------------------------------------ 0x0 0 Normal Service 0 Best Effort 1 0x2 1 Minimize Monetary Cost 0 Best Effort 1 0x4 2 Maximize Reliability 0 Best Effort 1 0x6 3 mmc+mr 0 Best Effort 1 0x8 4 Maximize Throughput 2 Bulk 2 0xa 5 mmc+mt 2 Bulk 2 0xc 6 mr+mt 2 Bulk 2 0xe 7 mmc+mr+mt 2 Bulk 2 0x10 8 Minimize Delay 6 Interactive 0 0x12 9 mmc+md 6 Interactive 0 0x14 10 mr+md 6 Interactive 0 0x16 11 mmc+mr+md 6 Interactive 0 0x18 12 mt+md 4 Int. Bulk 1 0x1a 13 mmc+mt+md 4 Int. Bulk 1 0x1c 14 mr+mt+md 4 Int. Bulk 1 0x1e 15 mmc+mr+mt+md 4 Int. Bulk 1 The second column contains the value of the relevant four TOS bits, followed by their translated meaning. For example, 15 stands for a packet wanting Minimal Monetary Cost, Maximum Reliability, Maximum Throughput AND Minimum Delay. The fourth column lists the way the Linux kernel interprets the TOS bits, by showing to which Priority they are mapped. The last column shows the result of the default priomap. On the command line, the default priomap looks like this: 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 This means that priority 4, for example, gets mapped to band number 1. The priomap also allows you to list higher priorities (> 7) which do not correspond to TOS mappings, but which are set by other means. This table from RFC 1349 (read it for more details) explains how applications might very well set their TOS bits: TELNET 1000 (minimize delay) FTP Control 1000 (minimize delay) Data 0100 (maximize throughput) TFTP 1000 (minimize delay) SMTP Command phase 1000 (minimize delay) DATA phase 0100 (maximize throughput) Domain Name Service UDP Query 1000 (minimize delay) TCP Query 0000 Zone Transfer 0100 (maximize throughput) NNTP 0001 (minimize monetary cost) ICMP Errors 0000 Requests 0000 (mostly) Responses <same as request> (mostly) CLASSES
PRIO classes cannot be configured further - they are automatically created when the PRIO qdisc is attached. Each class however can contain yet a further qdisc. BUGS
Large amounts of traffic in the lower bands can cause starvation of higher bands. Can be prevented by attaching a shaper (for example, tc- tbf(8) to these bands to make sure they cannot dominate the link. AUTHORS
Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru>, J Hadi Salim <hadi@cyberus.ca>. This manpage maintained by bert hubert <ahu@ds9a.nl> iproute2 16 December 2001 PRIO(8)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy