Sponsored Content
Full Discussion: filling variable with ls
Top Forums UNIX for Dummies Questions & Answers filling variable with ls Post 302319128 by devtakh on Sunday 24th of May 2009 06:14:42 AM
Old 05-24-2009
Code:
for file in *.jpg
do
var1=${file%%-*}
var2=-${file#*-}
echo $var1
echo $var2
done


-Devaraj Takhellambam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

postfix queue filling up

What is filling up my postfix queue (/var/spool/postfix/deferred/)? I had a perl script running via crontab to monitor my IP connection and send me a mail via sendmail. Now I have a huge queue of emails I keep getting. I've removed the crontab and the script. If I clear out... (0 Replies)
Discussion started by: kumakuma
0 Replies

2. Solaris

Filesystem filling up and no clue as to why!

df shows that the filesystem is filling up and the usage is 94%. However when I actually traverse to the directory I du shows only about 10% of the space occupied! Below is the output of df and du: >>>df -kh /cbmdata/00 470M 393M 29M 94% /cbmdata/00 >>>/cbmdata/00>... (3 Replies)
Discussion started by: zombiezparadize
3 Replies

3. Shell Programming and Scripting

Filling out a text

Hello, I have a problem with filling out a text. I have different lenghts in a file and would like to see that all the lines becomes the same length by putting a zero in front off the line. Please advice. Old File: ---------- 5432 233 3455 4432 New File: ----------- 5432 0233... (6 Replies)
Discussion started by: peterk
6 Replies

4. Emergency UNIX and Linux Support

Something is filling hard disk on its own.

I came in this morning to find that our mail server was down. Couldn't connect. I looked at logs. The logs complained about no space on device. I run df and it comfirms that the system disk (mounted on /) is at 100% capacity. I try to delete some files before attempting to look at cyrus. I rotate... (23 Replies)
Discussion started by: timgolding
23 Replies

5. Shell Programming and Scripting

filling a character

in my file data is like this 1,2,3 3,4,5,6,7,8 10,11,23,24 i want to make as 1,2,3,?,?,? 3,4,5,6,7,8 10,11,23,24,?,? here max no of words(separated by comma) in a line is 6.so every line contains 6 words.Line which have less than 6 words replaced with '?' as a word i have... (3 Replies)
Discussion started by: new2ubuntulinux
3 Replies

6. UNIX for Dummies Questions & Answers

Need help filling in ranges

I have a list of about 200,000 lines in a text file that look like this: 1 1 120 1 80 200 1 150 270 5 50 170 5 100 220 5 300 420 The first column is an identifier, the next 2 columns are a range (always 120 value range) I'm trying fill in the values of those ranges, and remove... (4 Replies)
Discussion started by: knott76
4 Replies

7. Solaris

Root partition filling up

I have a T1000 Sparc server that has a relatively small root partition which is 24Gb and a larger partition dedicated to /export/home that is approximately 100 Gb. We have a lot of data going to /var/audit and to /var/core/corefiles. Is there any non-destructive way to redirect files from... (4 Replies)
Discussion started by: goose25
4 Replies

8. Shell Programming and Scripting

/tmp filling up

Does anyone know of a way to redirect the ksh default of processing data in /tmp to another file system or / something else? My ksh script is parsing large DB files and it keeps filling up /tmp on the root disk. I have a 1 Tb disk with most of its space. How do I re-direct the /tmp ksh... (6 Replies)
Discussion started by: cchelten
6 Replies

9. Shell Programming and Scripting

Filling file with 10 zeros

I am stuck with a problem. I have some 100 files with extension .txt. The files look like this: 0 3 0 0 4 All files have variable number of characters and some files are completely EMPTY. I want to make columns of length 10 by putting zeros (0) after the numbers end and also 10... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

10. UNIX for Dummies Questions & Answers

Filling empty cells

How do you fill empty cells that do not have any data in them with "X" in a tab delimited text file? Thanks! (4 Replies)
Discussion started by: evelibertine
4 Replies
nisdefaults(1)							   User Commands						    nisdefaults(1)

NAME
nisdefaults - display NIS+ default values SYNOPSIS
nisdefaults [-adghprstv] DESCRIPTION
The nisdefaults utility prints the default values that are returned by calls to the NIS+ local name functions (see nis_local_names(3NSL)). With no options specified, all defaults will be printed in a verbose format. With options, only that option is displayed in a terse form suitable for shell scripts. See the example below. OPTIONS
The following options are supported: -a Print all defaults in a terse format. -d Print the default domain name. -g Print the default group name. -h Print the default host name. -p Print the default principal name. -r Print the default access rights with which new objects will be created. -s Print the default directory search path. -t Print the default time to live value. -v Print the defaults in a verbose format. This prepends an identifying string to the output. EXAMPLES
Example 1 Printing NIS+ defaults The following prints the NIS+ defaults for a root process on machine example in the foo.bar. domain: example# nisdefaults Principal Name : example.foo.bar. Domain Name : foo.bar. Host Name : example.foo.bar. Group Name : Access Rights : ----rmcdr---r--- Time to live : 12:00:00 Search Path : foo.bar. Example 2 Setting a variable in the shell script This example sets a variable in a shell script to the default domain: DOMAIN=`nisdefaults -d` Example 3 Printing the default time to live in verbose format This example prints out the default time to live in a verbose format: example% nisdefaults -tv Time to live : 12:00:00 Example 4 Printing the time to live in terse format This example prints out the time to live in the terse format: example% nisdefaults -t 43200 ENVIRONMENT VARIABLES
Several environment variables affect the defaults associated with a process. NIS_DEFAULTS This variable contains a defaults string that will override the NIS+ standard defaults. The defaults string is a series of tokens separated by colons. These tokens represent the default values to be used for the generic object properties. All of the legal tokens are described below. ttl=time This token sets the default time to live for objects that are created. The value time is specified in the format as defined by the nischttl(1) command. The default value is 12 hours. owner=ownername This token specifies that the NIS+ principal ownername should own created objects. The default for this value is the principal who is executing the command. group=groupname This token specifies that the group groupname should be the group owner for created objects. The default is NULL. access=rights This token specifies the set of access rights that are to be granted for created objects. The value rights is specified in the format as defined by the nischmod(1) command. The default value is: ----rmcdr---r---. NIS_GROUP This variable contains the name of the local NIS+ group. If the name is not fully qualified, the default domain will be appended to it. NIS_PATH This variable overrides the default NIS+ directory search path. It contains an ordered list of directories separated by ':' (colon) characters. The '$' (dollar sign) character is treated specially. Directory names that end in '$' have the default domain appended to them, and a '$' by itself is replaced by the list of directories between the default domain and the global root that are at least two levels deep. The default NIS+ directory search path is '$'. Refer to the Name Expansion subsection in NIS+(1) for more details. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nischmod(1), nischttl(1), NIS+(1), nis_local_names(3NSL), attributes(5) NOTES
NIS+ might not be supported in future releases of the Solaris operating system. Tools to aid the migration from NIS+ to LDAP are available in the current Solaris release. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.11 2 Dec 2005 nisdefaults(1)
All times are GMT -4. The time now is 08:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy