Sponsored Content
Top Forums Shell Programming and Scripting variable option not properly recognized Post 302582397 by haishuva on Thursday 15th of December 2011 07:31:33 PM
Old 12-15-2011
Thanks! That fixed it. getopts seems very useful. When I am not working on class assignments I think that would be more straightforward to use.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Env Variable substituion in Sed (-s option)

Folks, I've been trying to use the ENV variable with slashes(/) in its value inside the sed substitution.. Sed 's/myval/'$MYVAL'/' file1 >> file.tmp If MYVAL=<sometext>, it works. if MYVAL=/home/venkat, it doesnt. *************************** bash-2.05$ export VAL=/home/venkat... (5 Replies)
Discussion started by: gvsreddy_539
5 Replies

2. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies

3. Shell Programming and Scripting

How can I use a pipe operator in a variable: OPTION="| command"?

I have a string of commands I am piping some data through and I want to allow command line switches to select which commands are used. I want to do something like this: OPTION="| command3" command1 -a -b c.txt | command2 -d -e $OPTION >result.txt I want to do it that way because OPTION may be... (1 Reply)
Discussion started by: KenJackson
1 Replies

4. Shell Programming and Scripting

AWK: pattern not properly stored in variable?

Hey there, I have a table of contents file of the form 1 Title1 1.1 Subtitle1 1.1.1 Subsubtitle1 1.1.2 Subsubtitle2 ... and want to count the number of dots in the first field to find out the level of the section. I use the gsub function for the job, which works if I pass the pattern... (2 Replies)
Discussion started by: herrsimon
2 Replies

5. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

6. Shell Programming and Scripting

cp not dealing with variable properly? please help

I am having trouble with a script that is supposed to : a)take all the jpg pictures in a given directory/parameter and create thumbnails of it in a directory on the desktop. e.g from /here/are/the/files.jpg to ~/Desktop/parser-the/files.png this is my script: all the individual parts... (2 Replies)
Discussion started by: orochinagi
2 Replies

7. Shell Programming and Scripting

How to use a variable as a command option?

I am just learning shell scripting and already I found out I have the bad habit of thinking that it is similar to php or c. I learned some basics and now encountered this problem: On shell it is possible to type: $ date --date="2009-10-10 09:08:34" Sat Oct 10 09:08:34 CEST 2009 ... (2 Replies)
Discussion started by: quinestor
2 Replies

8. UNIX for Dummies Questions & Answers

~c is not working properly with -r option

Hi There, --------- file1 ------- ~c asd@ac.com -------------- Now i am using below command cat file1|mailx -s " testing" -r " My Name" abc@tech.com (3 Replies)
Discussion started by: Tapan Sharma
3 Replies

9. Shell Programming and Scripting

Variable inside -name option for find command

Hi, I am not able to get output for find command if there are variables defined inside -name option . Please check below example 1) ###VARIABLES DEFINED process="fast" temperature="125c" voltage="0p935v" 2) I don't get output for below find command find -L <PATH> -type f \( -name... (2 Replies)
Discussion started by: gujrathinr
2 Replies

10. Shell Programming and Scripting

Passing a variable value to an option

Hello, I am new to shell (i.e. linux bash) programming and have the following question: When using this wget command I can download a certain website that needs login information by passing a previously acquired cookie: wget --header='Cookie: SID=ac658ef0876b24ff456' somewebsite.comAs... (5 Replies)
Discussion started by: iggy98
5 Replies
cachefspack(1M) 					  System Administration Commands					   cachefspack(1M)

NAME
cachefspack - pack files and file systems in the cache SYNOPSIS
cachefspack [-h] [-i | -p | -u] [-f packing-list] [-U cache-directory] [file...] DESCRIPTION
The cachefspack utility is used to set up and maintain files in the cache. This utility affords greater control over the cache, ensuring that the specified files are in the cache whenever possible. cachefspack does not pack files when the backfileystem type for the cachefs mount is NFSv4. This is because only pass-through support is available for cachefs with NFSv4. OPTIONS
The following options are supported: -f packing-list Specify a file containing a list of files and directories to be packed. Options within subdirectories and files can also be specified. The format and rules governing packing-list are described on the packingrules(4) manual page. Directories are packed recursively. Symlinks that match a regular expression on a LIST command are followed. Sym- links encountered while recursively processing directories are not followed. -h Help. Print a brief summary of all the options. -i View information about the packed files. -p Pack the file or files specified by file. This is the default behavior. -u Unpack the file or files specified by file. -U cache-directory Unpack all files in the specified cache directory. OPERANDS
The following operands are supported: file A path name of a file to be packed or unpacked. USAGE
See largefile(5) for the description of the behavior of cachefspack when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). EXAMPLES
Example 1: Packing a File in the Cache The following example packs the file projects in the cache: % cachefspack -p projects Example 2: Packint Files in the Cache The following example packs the files projects, updates, and master_plan in the cache: % cachefspack -p projects updates master_plan Example 3: Unpacking a File From the Cache The following example unpacks the file projects from the cache: % cachefspack -u projects Example 4: Unpacking Files From the Cache The following example unpacks the files projects, updates, and master_plan from the cache: % cachefspack -u projects updates master_plan Example 5: Unpacking All Files From in a Cache Directory The following example unpacks all files in the cache directory cache1: % cachefspack -U /cache/cache1 Example 6: Using a Packing List The following example illustrates the use of a packing list to specify files to be packed in the cache. The contents of lists.pkg are as follows: IGNORE SCCS BASE /src/junk LIST *.c LIST *.h The following command packs all files in the /src/junk directory which have .c and .h extensions, and do contain the string SCCS in the file's path name: % cachefspack -f lists.pkg EXIT STATUS
0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
cfsadmin(1M), mount_cachefs(1M), packingrules(4), attributes(5), largefile(5) SunOS 5.10 18 Mar 2004 cachefspack(1M)
All times are GMT -4. The time now is 08:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy