Sponsored Content
Full Discussion: Stripped argument
Top Forums Shell Programming and Scripting Stripped argument Post 302090975 by aigles on Thursday 28th of September 2006 09:33:33 AM
Old 09-28-2006
The value of the variable EXP is specified between ", so the shell interprets the value before affectation.
$6 is replaced by the value of argument 6 which seems to be be not set in your case.

Protect $6 with \ to avoid substitution:
Code:
export DEV="/usr/sbin/diskutil list | /usr/bin/grep Master | /usr/bin/awk '{ print \$6 }'"

or use simple quotes ', in that case internals simple quotes must be protected :
Code:
export DEV='/usr/sbin/diskutil list | /usr/bin/grep Master | /usr/bin/awk \'{ print $6 }\''


Jean-Pierre.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Stripped install by floppy only.

I want to make an installation on a thinkpad 701C: 486/16Mb/500Mb. Except the kernel, I need support for program development in as many languages as possible but at least C/C++ and Lisp. My only choice is to install by floppy disks only. Which distribution should I choose, and are there any other... (2 Replies)
Discussion started by: Nietzsche
2 Replies

2. Programming

xldb WARNING: libC.a(ansi_32.o) has been stripped

Hi, When i start the Debugger i get this warning: xldb WARNING: /usr/lpp/xlC/lib/libC.a(ansi_32.o) has been stripped. anyone know what this warning means? xldb is a Debugger under AIX. Lazzar (2 Replies)
Discussion started by: Lazzar
2 Replies

3. Shell Programming and Scripting

get positive number n as argument script must calculate the factorial of its argument

Can someone please help me with this SHELL script? I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1. Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies

4. Shell Programming and Scripting

Replacing stripped off leading zeros in shell script

I have a script which is taking a 10 character variable (BOC) input by the user. If it begins with a zero, the script unwittingly strips that off, & passes a 9 characters variable. echo -n "Enter core-follow date/time for BOC: " setenv BOC $< The next bit of code picks up the 9... (4 Replies)
Discussion started by: wtaicken
4 Replies

5. SCO

New line being stripped from sed command

Hi, I am trying to insert text to the beginning of a text file with 'sed'. Its working however the new line is getting stripped. I have a variable with the text that I want to insert: VAR="This is the header line \n March 22, 2010 \n" sed "1i\\ $VAR" logfile >tmpfile The text gets... (3 Replies)
Discussion started by: nck
3 Replies

6. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

7. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

8. Shell Programming and Scripting

Inputs required in decoding file on AIX- executable (RISC System/6000) or object module not stripped

Hi, We are in the process of migrating from AIX to Linux. There is a script of type "executable (RISC System/6000) or object module not stripped" on AIX and we are unable to read the contents of it. Is there a way to read the contents of the file on AIX, so that we can rewrite the code in... (3 Replies)
Discussion started by: venkatesh17
3 Replies

9. Shell Programming and Scripting

Print all with along with stripped one column string

Hi, My output data from software tool is like 1234 84 test1 file:about user_detials(bankUser) :jpeg 10 40 xys 1356 2 branches dir:list of files(dirlisting:1) :directory 20 80 abc and want this to be printed as below. where first and last 3 columns along with the string which is in the... (6 Replies)
Discussion started by: ratheeshp
6 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy