Sponsored Content
Full Discussion: Using variable in ls command
Top Forums Shell Programming and Scripting Using variable in ls command Post 302334064 by System Shock on Tuesday 14th of July 2009 04:37:04 PM
Old 07-14-2009
How about posting the error you get, and how you declared that variable?
"It's not working" doesn't really help.

I will tell you though, if the path is "changing dynamically" your variable is not going to mean anything once the path changes.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

2. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

3. UNIX for Dummies Questions & Answers

sed insert command and variable expansion/command substitution

I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename? #!/bin/bash filename=`echo $0` /usr/bin/sed '/#include/ { i\ the filename is `$filename` }' $1 exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies

4. Shell Programming and Scripting

command in variable

I am making a pipeline of several commands. This is a part of my shell script. array=( "mkdir src" "ls -l | grep tk_ > src/list" ) len=${#array } i=0; while ; do echo ${array} if !(${array}); then exit 1; fi; let i++ done --------------------------------------- "mkdir... (5 Replies)
Discussion started by: thsuk1
5 Replies

5. Shell Programming and Scripting

How to use variable with command substitution in variable

For example I have variable like below echo $OUTPUT /some/path/`uname -n` when I try to use the variable OUTPUT like below cd $OUTPUT or cd ${OUTPUT} I am getting bad substituion error message $ cd $OUTPUT ksh: cd: bad substitution $ cd ${OUTPUT} ksh: cd: bad substitution ... (1 Reply)
Discussion started by: rajukv
1 Replies

6. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

7. 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

8. Shell Programming and Scripting

SH script, variable built command fails, but works at command line

I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes CC=`which gcc` CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies

9. Shell Programming and Scripting

Command in a variable

i want to copy the command awk -F "=" '{print $2}' in a user defined variable for later/multiple use... Please let me know how to do that.. (11 Replies)
Discussion started by: shreedhar.rk123
11 Replies

10. UNIX for Beginners Questions & Answers

Need to pass variable in a command and assign value to a variable

Hello All, Hope you're doing well ! I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted. header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies
lugadmin(1M)															      lugadmin(1M)

NAME
lugadmin - long user and group name enablement and display SYNOPSIS
num] DESCRIPTION
The command enables the support of long user and group names on the system, sets the default display width for long user and group names, and displays the current status of the system. If no options are specified, the option is assumed. Options The following options are supported: Enable long user and group name support on the system. See the subsection below for details. This option requires superuser privileges. Set num as the default display width for long user and group names. num can be in the range to The option can be only be specified with the option or when long names have been previously enabled. See the subsection below for details. This option requires superuser privileges. Display the current status of the system. The command displays one of: The system is restricted to short (8-byte) user and group names. The system is enabled for long (255-byte) user and group name support. A name string can be up to 255 bytes plus a trailing NULL byte. Enabling Long User and Group Names To enable long user and group names, 1. Stop the daemon. 2. Run the command with the option. 3. The command requests confirmation before enabling the system. If you respond with or the command proceeds; otherwise, it aborts. 4. The command creates the file. 5. If the option is not specified, num defaults to The specified or default value of num is written in Setting the User and Group Name Display Width The long user and group name default display width is set when is executed with the option. It can be changed at any time by executing with the option. If is not specified with the option, the value of num defaults to Application Usage Use one of these: o in program code; see sysconf(2) and the section. o in program code; see ug_display_width(3C). o in shell scripts; see getconf(1) and the section. o in shell scripts and all return either (short names) or (long names). See ug_display_width(3C) for its return values. Use one of the following procedures: o In program code, call o In a shell script, 1. Run or to see if long names are enabled. If not enabled, set width to 2. Else, if enabled, check for the environment variable. If the variable is set to a value between set width to the value. Oth- erwise set width to 3. Else, if not set, set width to the value in the file. Set width to if the value is out of range, not an integer, or improperly formatted. The current display width is used by all system and conforming applications to display formatted output. See section of ug_dis- play_width(3C) for usage of current display width. EXTERNAL INFLUENCES
Environment Variables If it is set and long names are enabled, it overrides the width specified in the file for all system and conforming applications that write formatted output. RETURN VALUE
exits with one of the following values: Successful completion Failure DIAGNOSTICS
You may have attempted to use the option for a second time. You tried to use the option before using the option. A call to the function failed. WARNINGS
The file is the switch that marks a long name system. If it is missing, short names are assumed and the variable is ignored. While many programs are unaffected by long names in a short name environment, some may behave abnormally and some may abort. It is recommended that you do not attempt to restore the short name environment once long names have been enabled. Do not use the system constant with the command or the function to test for name length; it is not changed when long names are enabled. AUTHOR
was developed by HP. FILES
If this file is present, the system is enabled for long user and group names; otherwise, it is not. This file contains the default display width, as set with the option. SEE ALSO
getconf(1), sysconf(2), ug_display_width(3C) lugadmin(1M)
All times are GMT -4. The time now is 10:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy