Sponsored Content
Top Forums Shell Programming and Scripting Script running in bash 3.0 not in 3.2 Post 302281055 by trutoman on Wednesday 28th of January 2009 05:57:59 AM
Old 01-28-2009
Thats true, in Ubuntu i have an alias ls="ls --color", but unfortunately thats not the problem. I have run the script with your suggestion, and the output remains the same.

Quote:
+ DEPTH=-1
+ MAIN dir_1 dir_2
++ DRAW_DEPTH -1
++ ROUND=-1
++ '[' -1 -ge 0 ']'
++ printf %s '|- '
+ TAB='|- '
++ command ls -l dir_1
++ ls -l dir_1
++ awk '{print $9}'
+ DIR_LIST=
Thx again but.....anything else?
Perhaps the name of first argument ..... ./dir_1 dir_1 ./dir_1/
i have tested but its always the same.... plz help!!
 

10 More Discussions You Might Find Interesting

1. Linux

Cannot running export database using bash script

Hi all, I'm new in linux. When I try to run a bash script, it doesn't execute and i receive the following error message 20070321:220002|ERROR||exportDatabase.bash|Another EXPORT process (pid=2799) is still running. If i kill this pid, i receive "No such process". This process was running... (5 Replies)
Discussion started by: tovohery
5 Replies

2. UNIX for Advanced & Expert Users

debugging an already running bash script

# ps -ef | grep rc root 13903 1 0 08:56 ? 00:00:00 /usr/sbin/automount --timeout=60 /archive file /etc/auto_archive root 10706 1 0 08:55 ? 00:00:00 /bin/bash /etc/rc.d/rc 3 root 2933 20071 0 19:38 pts/1 00:00:00 grep rc Is there any way to debug the... (1 Reply)
Discussion started by: marcpascual
1 Replies

3. Shell Programming and Scripting

Validate BASH script before running it...

Hello, Is there some way to validate a bash script before running it. I want to make sure all of the syntax and everything is good so that I dont get a false return code. Thanks, tom (7 Replies)
Discussion started by: tjones1105
7 Replies

4. UNIX for Dummies Questions & Answers

Running Executable in Bash Script

Hey guys, so I've been trying to write a bash script called runSorter.sh that runs an executable that also takes in some parameters and outputs the results to a text file. The executable, sorter, takes in a number parameter. I want to make it so that you can input as many number parameters into... (4 Replies)
Discussion started by: Duo11
4 Replies

5. UNIX for Dummies Questions & Answers

Help Running a Check in Bash Script

Hey guys, so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g. unknown-hacker|544> count.sh 1 3 1 2 3 My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2... (2 Replies)
Discussion started by: Duo11
2 Replies

6. Shell Programming and Scripting

script running by sh but not by bash

execute the attached script as, bash -x INFA_MAP_GEN_XML.sh "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/SOURCE" "INFA_TEMPLATE.csv" "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/TARGET" "UNIX" "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/SETUP"... (5 Replies)
Discussion started by: 120945
5 Replies

7. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

8. UNIX for Dummies Questions & Answers

Running a C/C++ program and/or bash script from a server

I wish to be able to give to a client the opportunity to : 0) Turn one of my ubuntu computers into a webserver 1) See a webpage after visiting a url where an external user/client can set a couple of variables (e.g. Number1= ?, Number2=?) 2) By pressing "run" the program runs on my machine 3)... (1 Reply)
Discussion started by: frad
1 Replies

9. Shell Programming and Scripting

Running options in bash script

Hello UNIX & Linux Forums community! Long time Linux daily user hobbyist, new to shell scripting.... I'm working on a script that does all the "work" in one script, and makes calls to a second script to display info to the user via mostly expanding variables in heredocs. I'm contemplating... (6 Replies)
Discussion started by: Cody Learner
6 Replies

10. Shell Programming and Scripting

Running nmap via bash script

Hello fellow scripters... I am trying to set up a script for work that reads the contents of a file of IP address and network names, takes these and runs a given nmap scan against them and then saves the output to a file with the filename of the network name. Such as... IP file looks like... (4 Replies)
Discussion started by: hawkeyesc72
4 Replies
nvbmtpg(8)						      System Manager's Manual							nvbmtpg(8)

NAME
nvbmtpg - Display pages of an AdvFS BMT file SYNOPSIS
/sbin/advfs/nvbmtpg [-R] [-v] { domain_id | bmt_id } [-f] /sbin/advfs/nvbmtpg [-R] [-v] bmt_id page [-f] /sbin/advfs/nvbmtpg [-R] [-v] bmt_id page mcell [-c] /sbin/advfs/nvbmtpg [-R] [-v] bmt_id [-a] /sbin/advfs/nvbmtpg [-R] [-v] domain_id fileset_id [file_id] [-c] /sbin/advfs/nvbmtpg [-R] [-v] { domain_id | volume_id } -l /sbin/advfs/nvbmtpg [-R] [-v] bmt_id -s b block [-c] /sbin/advfs/nvbmtpg [-R] [-v] domain_id fileset_id -s f frag [-c] /sbin/advfs/nvbmtpg [-R] [-v] { bmt_id | domain_id [fileset_id] } -s t tag [-c] /sbin/advfs/nvbmtpg [-R] [-v] volume_id -b block [mcell] /sbin/advfs/nvbmtpg [-R] volume_id -d dump_file OPTIONS
Display all the pages in the BMT. Specifies the logical block number of a disk block on an AdvFS volume. Display the entire chain of mcells. Alternatively, continue to search. Specifies the name of a file that will hold the contents of the specified BMT file. Display the number of free mcells. Display the deferred delete list of mcells. Specifies that information about the Reserved Bitmap Metadata Ta- ble (RBMT) is to be displayed, instead of information about the BMT. Specifies the logical block number of a disk block on an AdvFS vol- ume. When you use this option, the utility searches the specified BMT file for a mcell that has an extent record for a file that contains the specified block. Specifies the number of a file fragment in the frag file for a fileset. When you use this option, the utility searches all BMT files (there is one on each AdvFS volume) for a mcell that: Belongs to a file in the specified fileset Has an attribute record that indicates the file is using the specified frag ID. Specifies the file tag number. When you use this option, the utility searches one or all of the BMT files for a mcell with this tag. Display all the data in a specified mcell. OPERANDS
Specifies the BMT file on an AdvFS volume or a BMT file that has been saved by the utility as a dump_file. Use the following format: Spec- ify the -F option to force the utility to interpret the name you supply as a file name. Specifies an AdvFS file domain using the following format: By default, the utility opens all volumes using block device special files. Specify the -r option to operate on the raw device (character device special file) of the domain instead of the block device. Specify the [-D] option to force the utility to interpret the name you supply in the domain argument as a domain name. Specifies an AdvFS volume using the following format: Specify the -V option to force the utility to interpret the name you supply in the volume argument as a volume name. The volume name argument also can be a full or partial path for the volume, for example /dev/disk/dsk12a or dsk12a. Specifying a partial path name always opens the character device spe- cial file. Alternatively, specify the volume by using arguments for its domain, domain_id, and its volume index number, volume_index. Speci- fies an AdvFS fileset using the following format: Specify the [-S] option to force the command to interpret the name you supply as a fileset name. Specify the fileset by entering either the name of the fileset, fileset, or the file's fileset tag number, -T file- set_tag. Specifies a file name in the following format: Specify the file by entering either the fileset relative pathname, file, or the file's tag number, -t file_tag. Specifies the number of a metadata cell (mcell) in a BMT file. Specifies the file page number of the BMT file. DESCRIPTION
The nvbmtpg utility formats, dumps, and displays pages of the Bitfile Metadata Table (BMT) files. For Tru64 UNIX Version 5.0 and beyond, the utility also formats, dumps, and displays pages of the Reserved Bitfile Metadata Table (RBMT) files. RBMT files are metadata structures that extend BMT files. BMTs are composed of mcells. Each file in an AdvFS domain is described by a collection of mcells. The mcells for each file are chained together. The first mcell in a chain is called the primary mcell. There is one BMT file on each volume of an AdvFS domain. A BMT file is an array of 8 Kbyte file pages, each page containing a header and an array of metadata cells (mcells). The purpose of a BMT file is to contain all the metadata for all files that are stored on an AdvFS volume. This utility has the following functions: Display a summary of the BMT on one AdvFS volume or a summary of all the BMT files (there is one per volume) in a domain. Display a page of mcells or one mcell or a chain of mcells. The page can be specified by a BMT page number or a volume block number. An mcell can be specified by a number or by specifying the primary mcell of a file. Search for an mcell. The search can be for an extent that maps a volume block or a file that uses a given frag ID. Display a Summary of BMTs By specifying just a domain and (possibly) the -f option, you cause the utility to display a summary of the BMT on all volumes in the domain. Without the -f option, the summary shows how long the BMT is, in pages. With the -f option, the summary also displays how many free mcells are in the BMT for each volume. For example, the following command causes the utility to read BMT page 0 (zero) in every volume of the domain and display the number of pages in each BMT, the number of extents used to describe the BMT, and the number of free mcells in BMT page 0: # /sbin/advfs/nvbmtpg -r my_domain For example, the following command causes the utility to read the entire BMT in every volume of the domain and display the number of pages in each BMT, the number of extents use, and the number of free mcells in BMT page 0. In addition, the utility displays the number of free mcells not on page 0: # /sbin/advfs/nvbmtpg my_domain -f Specifying just a volume (and possibly the -f option) displays a summary for the BMT on that volume. Two examples are: # /sbin/advfs/nvbmtpg -D my_domain 1 -f # /sbin/advfs/nvbmtpg dsk12c Displaying a BMT Page The utility can display information from a specified BMT page. It can display the whole page or one mcell on a page. It can also display all the mcells on an AdvFS volume. Each AdvFS volume contains its own BMT file, so you must specify the volume and the page to get the page you want to display. For example, to display the first page (page 0) of the BMT on volume /dev/disk/dsk5a, you would enter the following command: # /sbin/advfs/nvbmtpg /dev/disk/dsk5a 0 The volume can also be specified by domain name and volume index. For example, to display page 0 or volume 1 of the domain_1 domain, enter the following command: # /sbin/advfs/nvbmtpg domain_1 1 0 You can specify a single mcell to display. For example, you could display mcell 5 on page 4 of the third AdvFS volume in the file domain domain_1 by entering the following command: # /sbin/advfs/nvbmtpg domain_1 3 4 5 To display all the mcells on dsk5a, enter the following command: # /sbin/advfs/nvbmtpg /dev/disk/dsk5a -a Note This use of the command can generate megabytes of output: use it carefully. Displaying Primary mcells The primary mcell of a file in an AdvFS domain is the first mcell in a chain of mcells that describe the file. The primary mcell for a fileset in an AdvFS domain is the first mcell in a chain of mcells that describes the fileset. Use this utility to locate and display the primary mcell of a file or a fileset. To locate the primary mcell (for either a file or a fileset) you must uniquely identify it in the command line. A fileset can be uniquely identified by its domain and fileset names. A file can be uniquely identified by its domain, fileset, fileset relative path name. For example, you can display the primary mcell for a file file_1 in a directory dir_1 in a fileset fileset_1 in a domain domain_i by enter- ing the following command: # /sbin/advfs/nvbmtpg domain_1 fileset_1 dir_1/file_1 You can also display the primary mcell by its tag number. For example, if the file_1 had a tag number of 5, the command to display the pri- mary mcell for the file would be: # /sbin/advfs/nvbmtpg domain_1 fileset_1 -t 5 Note If there is no danger of confusing tag 5 with a file named 5 in the root directory, then the -t option is optional. Displaying mcell Chains The mcells that describe one BMT file are chained, and are not necessarily contiguous. Use the [-c] option to display these mcell chains. For example, display the entire chain of mcells that describe the file named file_1 in the root directory of the fileset named fileset_1 in the domain named domain_1, enter the following command: # /sbin/advfs/nvbmtpg domain_1 fileset_1 file_1 -c Displaying the Deferred Delete List Each volume in a domain has a linked list of mcells which represent storage to be freed. The -l option displays the mcells in this list. If just the domain is specified, the option displays the deferred delete list for every volume in the domain. For example: # /sbin/advfs/nvbmtpg domain_1 -l If an AdvFS volume is specified, the option displays the deferred delete list for that volume. For example: # /sbin/advfs/nvbmtpg dsk5c -l Displaying Corrupted Volumes If the volume is corrupted, the metadata structure needed to find specific mcells can be missing. In this case, you can specify a disk block and the utility displays a page containing the specified disk block. For example: you have a corrupted AdvFS domain, but you have the logical block number of a BMT page. To display logical block number 1024 on AdvFS volume /dev/disk/dsk5c in AdvFS domain domain, forcing it to be formatted as a BMT page, you use the following command: # /sbin/advfs/nvbmtpg dsk5c -b 1024 For example: you have a corrupted AdvFS domain, but you have a domain and an index number and the logical block number of a BMT page. To display logical block number 1024 on AdvFS volume 2 in AdvFS domain domain, forcing it to be formatted as a BMT page, you use the following command: # /sbin/advfs/nvbmtpg domain 2 -b 1024 Saving a BMT File Use the utility to read the BMT file and save it to another file. Later, you can use the utility to display information from this dump_file. For example, to save the BMT file from volume index 2 in a domain named domain_1 to a file named dump_domain.2 in the current working directory, enter the following command: # /sbin/advfs/nvbmtpg domain_1 2 -d dump_domain.2 Later, you can examine the file dump_domain.2 to obtain a summary of its BMT pages, by entering the following command: # /sbin/advfs/nvbmtpg dump_domain.2 You can also use the utility to display other information from the dump_file, such as: any mcell, a page of mcells, or the mcell free list in a page of mcells. Searching for Disk Blocks You can determine which file is using a logical block number by searching for and displaying the mcell that contains a file extent that includes that block. The mcell contains the fileset tag and the file tag number of the file that includes that block. Use the tag2name utility to find the file name. For example, you can search for a mcell record that describes the use of a disk block on an AdvFS volume. If you want to determine which file was using logical block number 1234 on AdvFS volume dsk12c, you can enter the following command: # /sbin/advfs/nvbmtpg dsk12c -s b 1234 A given block should only appear in one mcell. However, a corrupted volume may have two or more extents describing the same block. There- fore, if you want to find the disk block shown above and continue the command, searching for any files that also have a file extent that includes block 1234, you can enter the following command: # /sbin/advfs/nvbmtpg dsk12c -s b 1234 -c Searching for Fragment Files AdvFS creates one fragment file for each fileset in an AdvFS file domain. You can determine the file that is using a given file fragment ID and display the primary mcell for that file. For example, if you want to determine which file in domain domain and fileset fileset was using the fragment id 1234, you can enter the following command: # /sbin/advfs/nvbmtpg domain fileset -s f 1234 A given fragment ID can only be used by one file in a fileset. However, a corrupted fileset may have a given fragment ID used by two or more files. Therefore, if you want to find the fragment file ID above and continue the command, searching for any additional files that own the file fragment, you can enter the command: # /sbin/advfs/nvbmtpg domain fileset -s f 1234 -c Searching for a Specified Tag If you specify a domain, a fileset and a file tag (as shown before in the section on displaying primary mcells) the utility uses other metadata files in the domain to find the primary mcell in the BMT. However, the utility can also search for a mcell with a given tag with- out using any other metadata files if you specify the -s t option. This option searches a saved BMT file, or the BMT on one volume, or all the BMT files in a domain for an mcell with the tag you specify. If you specify a domain and fileset, the utility narrows the search to mcells that belong to the fileset. However, if you specify a fileset, the utility must use other metadata files in the domain. In this case, the search syntax displays the first mcell it finds that contains the specifed tag. This mcell could be (but may not be) the primary mcell for the file. To continue the search and display all mcells for the specified tag, add the -c option. The following example searches all BMT files for mcells with tag 123: # /sbin/advfs/nvbmtpg domain_1 -s t 123 -c The following example searches a saved BMT file for mcells that belong to file tag 456: # /sbin/advfs/nvbmtpg save_bmt -s t 456 -c NOTES
An active domain, which is a domain with one or more of its filesets mounted, has all of its volumes opened using block device special files. These devices cannot be opened a second time without first being unmounted. However, the character device special files for the volumes can be opened more than once while still mounted. It can be misleading to use this utility on a domain with mounted filesets because the utility does not synchronize its read requests with AdvFS file domain read and write requests. For example, the AdvFS can be writing to the disk as the utility is reading from the disk. Therefore, when you run the utility, metadata may not have been flushed in time for the utility to read it and consecutive reads of the same file page may return unpredictable or con- tradictory results. [The domain is not harmed.] To avoid this problem, unmount all the fileset in the domain before using this utility. RESTRICTIONS
The utility can fail to open a block device, even when there are no filesets mounted for the domain and the AdvFS daemon, advfsd is run- ning. The daemon, as it runs, activates the domain for a brief time. If the utility fails in this situation, run it again. EXIT STATUS
The utility returns a 0 (zero) on success, otherwise it returns a nonzero value and an error diagnostic. FILES
Specifies the command path. Specifies the AdvFS volumes in domain_name SEE ALSO
Commands: vfilepg(8), nvfragpg(8), nvlogpg(8), vsbmpg(8), nvtagpg(8), tag2name(8) nvbmtpg(8)
All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy