10-09-2019
Thx ...
my bad ... i edited the question ..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Hope all the expert can help me in this situation.
Let say I have one file with multiple record like below:
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST1
DIRECTORY=D:/DETAILS/1/0/test1.txt
END
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE (13 Replies)
Discussion started by: shirleyeow
13 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a directory file name:
/auto/space/user/jen/CED/CED_01MZ/visit1/DCE_2eco/016/echo1
I would like to just get the following outputs into variables such that:
variable1 = /auto/space/user/jen/CED/CED_01MZ/visit1/
and
variable2 = DCE_2eco/016/echo1
I've tried it with... (2 Replies)
Discussion started by: nixjennings
2 Replies
3. Shell Programming and Scripting
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies
4. Shell Programming and Scripting
Hi,
I have following path:
set file_path = D:/forums/prac/somedir/new1/file1.txt
or set file_path = E:/new/forums1/prac/somedir/new2/file2.txt
I need to grep "somedir" from file path. In this case preceding directory "prac" remains same for both the paths, but directories preceding... (7 Replies)
Discussion started by: sarbjit
7 Replies
5. Shell Programming and Scripting
Hello,
I searched the forums and didn't see a situation like this:
I cannot figure out how to parse out just the file name from the full path. The path looks like this:
\\foo\bar\filename.ext
I don't think something like 'cut' will work so I tried to whip up a regex but couldn't get it... (12 Replies)
Discussion started by: bytesnoop
12 Replies
6. Shell Programming and Scripting
I am looking to parse a text file output and set variables based on what is cropped from the parsing.
Below is my script I am looking to add this feature too.
All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies
7. Shell Programming and Scripting
Hi All,
i had to split one files into 10 equally. For that i have coded below awk.
OUTPUT_FILE=/home/sit/path/Files/file_EXPORT.lst
DIR_NM=`dirname ${OUTPUT_FILE}`
awk -v CURR_DATE="$(date +'%d-%m-%Y-%H-%M')" -v pth=$DIR_NM '{print >> pth/"tgt_file_name"CURR_DATE"_"NR%10 }' ${OUTPUT_FILE}
... (7 Replies)
Discussion started by: looney
7 Replies
8. UNIX for Beginners Questions & Answers
Hello,
I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
9. UNIX for Beginners Questions & Answers
What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
LEARN ABOUT FREEBSD
badsect
BADSECT(8) BSD System Manager's Manual BADSECT(8)
NAME
badsect -- create files to contain bad sectors
SYNOPSIS
badsect bbdir sector ...
DESCRIPTION
The badsect utility makes a file to contain a bad sector. Normally, bad sectors are made inaccessible by the standard formatter, which pro-
vides a forwarding table for bad sectors to the driver. If a driver supports the bad blocking standard it is much preferable to use that
method to isolate bad blocks, since the bad block forwarding makes the pack appear perfect, and such packs can then be copied with dd(1).
The technique used by this program is also less general than bad block forwarding, as badsect cannot make amends for bad blocks in the i-list
of file systems or in swap areas.
On some disks, adding a sector which is suddenly bad to the bad sector table currently requires the running of the standard DEC formatter.
Thus to deal with a newly bad block or on disks where the drivers do not support the bad-blocking standard badsect may be used to good
effect.
The badsect utility is used on a quiet file system in the following way: First mount the file system, and change to its root directory. Make
a directory BAD there. Run badsect giving as argument the BAD directory followed by all the bad sectors you wish to add. (The sector num-
bers must be relative to the beginning of the file system, but this is not hard as the system reports relative sector numbers in its console
error messages.) Then change back to the root directory, unmount the file system and run fsck(8) on the file system. The bad sectors should
show up in two files or in the bad sector files and the free list. Have fsck(8) remove files containing the offending bad sectors, but do
not have it remove the BAD/nnnnn files. This will leave the bad sectors in only the BAD files.
The badsect utility works by giving the specified sector numbers in a mknod(2) system call, creating an illegal file whose first block
address is the block containing bad sector and whose name is the bad sector number. When it is discovered by fsck(8) it will ask ``HOLD BAD
BLOCK ?''. A positive response will cause fsck(8) to convert the inode to a regular file containing the bad block.
DIAGNOSTICS
The badsect utility refuses to attach a block that resides in a critical area or is out of range of the file system. A warning is issued if
the block is already in use.
SEE ALSO
fsck(8)
HISTORY
The badsect utility appeared in 4.1BSD.
BUGS
If more than one sector which comprise a file system fragment are bad, you should specify only one of them to badsect, as the blocks in the
bad sector files actually cover all the sectors in a file system fragment.
BSD
June 5, 1993 BSD