Need Help with commands to automate.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need Help with commands to automate.
# 1  
Old 04-02-2013
Need Help with commands to automate.

HI,

In some test cases, I used tools like "dd" and "shed" to manually read a block from the disk, modify it using a hex editor and write it back using "dd".
I need help with some linux commands I can use to read the block and change the data to induce the corruption....as I want to automate my test case.

Thanks In Advance,
Prince Sharma


---------- Post updated at 05:39 AM ---------- Previous update was at 05:09 AM ----------

Test Scenario is like :
h)Using dd, copy out the contents of an EA block into a file.
i)Using shed editor, edit the contents at the offset 0004 to 00 instead of 01. This corrupts the EA header ref count.
j)Using dd, write back the contents of the modified block .

Plesae help me.

---------- Post updated at 06:29 AM ---------- Previous update was at 05:39 AM ----------

I do this to get a file with dumb block data.
Code:
dd bs=4096 skip="block number"  count=1 if=/dev/ivg2/ilv2 of=yy.out

Please help me with some shell command which I can use to read the dumb block data and modify it.

Last edited by jim mcnamara; 04-02-2013 at 09:24 AM..
# 2  
Old 04-02-2013
Well, what do you want to do to it?
# 3  
Old 04-02-2013
Well, the output from the dd comand is a binary file and i want to modify a value 01 at offset 0004 to 00.
# 4  
Old 04-02-2013
You can read a byte 00 from /dev/zero. Set the blocksize to 1 and dd can overwrite the specified 'block' in that file without shrinking or overwriting it otherwise(seek to skip forward in output, conv=notrunc to not shrink the file to 5 bytes)
Code:
dd if=/dev/zero of=blockfile bs=1 count=1 seek=4 conv=notrunc

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automate a task

Dear All, I am relatively new to UNIX and wanted to accomplish a simple task which should be automated. That's why I need your help. I shall briefly describe what I want. Basically, there is a process (X) (related to a particular software which I am using in my system) which automatically... (5 Replies)
Discussion started by: Samiran Dam
5 Replies

2. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies

3. Shell Programming and Scripting

Automate multiple commands

Hi, I am trying to count the number of times a string of letters occurs in a file for multiple unique strings of letters. Right now I can do this one at a time using the following code (in this example I am searching for the string "AAA"): echo AAA >> outfile.txt grep -c "AAA" -r... (4 Replies)
Discussion started by: gecko1
4 Replies

4. AIX

HACMP: difference between 'cl' commands and 'cli' commands

Hi all, I'm new in this forum. I'm looking for the difference between the HACMP commands with the prefix "cl" and "cli". The first type are under /usr/es/sbin/cluster/sbin directory and the second are under /usr/es/sbin/cluster/cspoc directory. I know that the first are called HACMP for AIX... (0 Replies)
Discussion started by: peppix
0 Replies

5. Windows & DOS: Issues & Discussions

automate the script

Dear all, I I want to login to my Linux machine using putty and then run some script from Windows machine.we can do it after loging it and then execute the script by typing it in putty command line screen. but I want to automate it.So whenever I will fire this script,it will do the following... (4 Replies)
Discussion started by: smartgupta
4 Replies

6. SuSE

automate ispell

Hello!! Is posible to automate ispell?? I have a lot of misspelled text and I want to launch a script that runs ispell choosing for example the first option, all that automatically. Is possible?? Thanks :) (4 Replies)
Discussion started by: elblo
4 Replies

7. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

8. UNIX for Advanced & Expert Users

Automate Script using pkgrm/pkgadd commands

This is my first post so hello to all of you! I have a script in bash-3.00 that needs to execute the following: pkgrm (to remove an existing package) pkgadd -d ( to install a new package) The problem is that both commands prompt me to answer either y,n or q in order to proceed with... (13 Replies)
Discussion started by: Insight
13 Replies

9. Programming

code that reads commands from the standard i/p and executes the commands

Hello all, i've written a small piece of code that will read commands from standard input and executes the commands. Its working fine and is execting the commands well. Accepting arguments too. e.g #mkdir <name of the directory> The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies

10. Shell Programming and Scripting

automate useradd

Hi I wounder if some one knows how to make a script to automate user adding? When i am starting the script it will add user like 04pers00 and fowllowing untill that i'm quit. The password will be a standard password typed in the file. I'm unsing Sun solaris 9 on Intel Sorry for my... (1 Reply)
Discussion started by: steffa
1 Replies
Login or Register to Ask a Question