Sponsored Content
Full Discussion: Stripped argument
Top Forums Shell Programming and Scripting Stripped argument Post 302090974 by jim mcnamara on Thursday 28th of September 2006 09:32:08 AM
Old 09-28-2006
That's because the shell treat $6 as a commandline variable - it doesn't see the awk block and know it's an awk command:
Code:
$ export DEV="/usr/sbin/diskutil list | /usr/bin/grep Master | /usr/bin/awk '{ print \$6 }'"

FWIW - what you want here is probably an alias unless you plan to :
Code:
eval $DEV

 

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
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. SunOS 5.10 30 Aug 2004 getusershell(3C)
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy