Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing a special line and Byte in a random file Post 302906158 by Corona688 on Tuesday 17th of June 2014 03:19:17 PM
Old 06-17-2014
The concept of "line" in a file made of random garbage data has no meaning.

One way to change byte 13 of testfile1 to "A":

Code:
echo "A" | dd bs=1 conv=notrunc seek=13 count=1 of=testfile1

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

2. Shell Programming and Scripting

Read random line from a text file

I have a text file with hundreds of lines, i wish to run a script and reads a random line to pass it to another command line such as: for line in `cat file |grep random line`; do echo $line |mail my@example.com ; done thank you (6 Replies)
Discussion started by: Bashar
6 Replies

3. Shell Programming and Scripting

changing line on a file

Hi, I want to change on a file this line: vif = into: vif = But there are some conditionals: 1. last part '] of the original line after 00:16:3E:CE:23:14' ] may vary to 00:16:3E:CE:23:14' ] or 00:16:3E:CE:23:14 ' ] 2. The second mac adrress of the line I need,... (4 Replies)
Discussion started by: iga3725
4 Replies

4. Shell Programming and Scripting

Replace 2nd column for each line in a csv file with fixed string+random number

Hi experts, My csv file looks like this U;cake;michael;temp;;;; U;bread;john;temp;;;; U;cocktails;sarah;temp;;;; I'd like to change the value fo 2nd column to cf+random number , which will look maybe something like this U;cf20187;michael;temp;;;; U;cf8926;john;temp;;;;... (7 Replies)
Discussion started by: tententen
7 Replies

5. Shell Programming and Scripting

Parse large file on line count (random lines)

I have a file that needs to be parsed into multiple files every time there line contains a number 1. the problem i face is the lines are random and the file size is random. an example is that on line 4, 65, 187, 202 & 209 are number 1's so there has to be file breaks between all those to create 4... (6 Replies)
Discussion started by: darbs121
6 Replies

6. Shell Programming and Scripting

cutting long text by special char around 100 byte and newline

Regard, How can i cut the text by special char(|) around 100 byte and write the other of the text at newline using Perl. ... (3 Replies)
Discussion started by: Shawn, Lee
3 Replies

7. Shell Programming and Scripting

Grab exactly one byte from a FIFO, at random intervals

I want to develop a script of the following form: #!/bin/bash # Function 'listen' opens a data stream # which stores all incoming bytes in # a buffer, preparing them to be # grabbed by a following function # which appears at random # intervals during the execution of # the script ... (11 Replies)
Discussion started by: vomv1988
11 Replies

8. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

9. UNIX for Dummies Questions & Answers

A crude random byte generator...

There was an upload recently on generating a pseudo-random file when /dev/random does NOT exist. This does not need /dev/random, /dev/urandom or $RANDOM either... (I assume $RANDOM relies on the /dev/random device in some way.) This code uses hexdump just because I like hexdump for ease of... (2 Replies)
Discussion started by: wisecracker
2 Replies

10. Shell Programming and Scripting

Replace Special Character With Next Present Byte

Hi, First find the special character, from the special character take next two bytes convert the bytes to decimal and replace with next present byte of decimal value times. E.g. Input: 302619ú1A? Output: 302619(3 spaces for ú1A)?????????????????????????? Thanks, Dines (27 Replies)
Discussion started by: dineshnak
27 Replies
mkcdsl(8)						      System Manager's Manual							 mkcdsl(8)

NAME
mkcdsl - Make a context-dependent symbolic link (CDSL) SYNOPSIS
/usr/sbin/mkcdsl [-bfnqv] [-i | -c | -a] [sourcename] [targetname] OPTIONS
All members. Copy the existing file or directory to a member-specific area on all members. Boot partition. In a cluster, the CDSL is placed on the boot partition. On a standalone system, an entry in added to the CDSL inventory file, and the CDSL will be created on the boot partition when the system is converted to a cluster by running clu_create. Copy the existing file or directory to a member-specific area on this member only. Force the overwriting of the existing CDSL or member-specific file or directory. When the force option is used with a copy option, mkcdsl will overwrite an existing member-specific file or directory. Without the force (-f) option, mkcdsl issues an error or message whenever the physical path of the target differs from the specified targetname (for example, when targetname resolution traverses a symbolic link), or when the source for a specified copy option cannot be found. Unless the -f option is specified, mkcdsl will exit when it encounters a situation that would generate an error message. The mkcdsl command issues a warning message if the specified sourcename differs from the calculated sourcename. However, you do not need the -f option to stop mkcdsl from exiting when it encounters a situation that generates a warning message. Inventory only. Check the files and update the inventory: If targetname is a CDSL, add a new entry or update the existing entry in /var/adm/cdsl_admin.inv. If targetname is not a CDSL or does not exist, remove its entry from /var/adm/cdsl_admin.inv. No execute mode. Display what would be done but do not create or change anything. Quiet. Stdout and stderr are redirected to /dev/null. Verbose. The pathname of the member-specific file to be linked. By default, each CDSL created by mkcdsl has a sourcename that points to the default member-specific area in the file system where the targetname resolves. For example, /usr/cluster/mem- bers/{memb}/ is the default member-specific area for the /usr file system. When issued without an explicit sourcename, mkcdsl creates a sourcename that points to this default member-specific area using a relative pathname. In most cases, this default behavior is satisfac- tory. It creates a relative link that resolves properly regardless of where the file system is mounted. If you specify a sourcename, mkcdsl uses this value as the pathname to the member-specific file or directory. The sourcename must include the member-context path compo- nent {memb}. The pathname of the new CDSL entry to be created. If targetname exists, the -f, -c or -a options are required. If the reso- lution of the targetname traverses any symbolic links or file system mount points, the default value of sourcename is adjusted such that the member-specific files are placed in the same file system to which targetname resolves. DESCRIPTION
A context-dependent symbolic link (CDSL) is a special form of a symbolic link, described in ln(1), whose target pathname includes a vari- able ({memb}). The value of {memb} is determined during pathname resolution, making it possible to maintain member-specific configuration and data files within the clusterwide namespace. The mkcdsl command creates a CDSL, effectively making the specified targetname file or directory member-specific. The command simplifies the creation of a CDSL by automatically calculating a default sourcename, which resolves to the default member-specific area in the file system where the CDSL is created. When mkcdsl creates a CDSL, it adds an inventory entry to a clusterwide CDSL inventory file, /var/adm/cdsl_admin.inv. This entry makes it possible for the cdslinvchk command to check CDSLs created by mkcdsl. The mkcdsl -i option updates the inventory file to reflect the cur- rent state of the CDSL by adding, modifying, or removing entries from the CDSL inventory file. In a cluster, when directed to put a file in a member-specific directory (-c or -a), mkcdsl populates both the member-specific directory or directories and the member0 directory. Although you can run mkcdsl from the command line, the mkcdsl command is designed to be non-interactive; it can be called from scripts without requiring user input to complete a task. EXAMPLES
To create a CDSL, /usr/testfile that points to cluster/members/{memb}/testfile: # mkcdsl /usr/testfile # ls -l /usr/testfile ... /usr/testfile -> cluster/members/{memb}/testfile In the previous example, /usr/testfile must not exist. The CDSL is created in /usr and no files are created in any member's /usr/clus- ter/members/{memb} directory. To copy the existing file or directory /usr/testfile1 to this member's /usr/cluster/members/membern directory and replace it with a CDSL that points to cluster/members/{memb}/testfile1: # mkcdsl -c /usr/testfile1 Although the CDSL references all members, only this member has a copy of the original /usr/testfile1 file. To copy the existing file or directory /usr/testfile2 to all members' /usr/cluster/members/{memb} directories and replace it with a CDSL that points to cluster/members/{memb}/testfile2: # mkcdsl -a /usr/testfile2 All members have a copy of the original /usr/testfile2 file. To create a CDSL and explicitly specify the sourcename: # mkcdsl /usr/share/cluster/members/{memb}/testfile3 /usr/share/doclib/testfile3 *** Warning *** The passed source name, '/usr/share/cluster/members/{memb}/testfile3' differs from the calculated source name: cluster/mem- bers/{memb}/testfile3 Using passed source name: '/usr/share/cluster/members/{memb}/testfile3' Because the specified sourcename differs from mkcdsl's calculated default value, the command issues a warning message. Note that mkcdsl makes the CDSL. The mkcdsl command does not exit on a warning message. It will exit for an *** Error *** message unless the -f option is specified. To add an inventory record for an existing CDSL to the /var/adm/cdsl_admin.inv file: # mkcdsl -i /etc/testfile4 To remove a CDSL and then remove its entry from the /var/adm/cdsl_admin.inv file: # rm /etc/testfile4 # mkcdsl -i /etc/testfile4 Note that removing the CDSL and its entry does not remove any files referenced by the CDSL. EXIT STATUS
The exit values for mkcdsl are: Success. Failure. FILES
Specifies the command path. CDSL administrative inventory file. This file will not exist on all systems. SEE ALSO
Commands: ln(1), cdslinvchk(8) Files: local(4) Miscellaneous: hier(5) mkcdsl(8)
All times are GMT -4. The time now is 08:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy