Sponsored Content
Full Discussion: Issues in sed command
Top Forums Shell Programming and Scripting Issues in sed command Post 302882765 by ctsgnb on Thursday 9th of January 2014 05:28:07 AM
Old 01-09-2014
Note that using sed with the -i option may change the inode of the file. Using ed with -s option wouldn't.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed issues with strange char

Hi all, I try to create a shell script to had the xiti tag at the end of servals web pages just before the <body/> tag. here is my script : #!/bin/bash ################################################################## rm -R /home/hibern/TEMP/hibern cp -R... (5 Replies)
Discussion started by: hibern
5 Replies

2. Shell Programming and Scripting

sed issues

Hi guys, not that used to using sed beyond the simple substitution. I am trying to check for a program (program1) and if it exists replace the standard output "program1" with a "program1(part1 part2) output if said program exists. SW="program1 program2" PROGRAM_TEST='echo "$SW" | grep... (3 Replies)
Discussion started by: mikepegg
3 Replies

3. Shell Programming and Scripting

sed edit in place -i issues

Hello, I am attempting to create a command that I can eventually put into a loop so I can edit 1file on many servers. I would like to edit the file in place with sed -i. If not I will take any suggestions on how to use a temp file. I need to remove a email address from the configuration file... (4 Replies)
Discussion started by: abacus
4 Replies

4. Shell Programming and Scripting

Filtering Issues Using sed and awk

Hi, I am currently using the sed and awk commands to filter a file that has multiple sets of data in different columns. An example of part of the file i am filtering is as follows; Sat Oct 2 07:42:45 2010 01:33:46 R1_CAR_12.34 Sun Oct 3 13:09:53 2010 00:02:34 R2_BUS_56.78 Sun... (4 Replies)
Discussion started by: crunchie
4 Replies

5. Shell Programming and Scripting

sed pattern and hold space issues

Good day. Trying to make a sed script to take text file in a certain format and turn it into mostly formatted html. I'm 95% there but this last bit is hurting my head finally. Here's a portion of the text- Budgeting and Debt: Consumer Credit Counseling of Western PA CareerLink 112... (5 Replies)
Discussion started by: fiendracer
5 Replies

6. Homework & Coursework Questions

sed & cut command issues

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: After using the egrep command to pull certain lines from the asg5f1 (creating the asg5f1c file), I am required... (1 Reply)
Discussion started by: robrom78
1 Replies

7. Shell Programming and Scripting

Issues with sed on SunOS

Why does the below command doesnt work fine on SunOS 5.10 $ cat t | AK| | | | | DS | | | | tAR | | | | | FIL | $ sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ *| */|/g' t |AK|||||DS|||| tAR|||||FIL| ##notice before tAR works fine on Linux OR AIX though ... (8 Replies)
Discussion started by: Shivdatta
8 Replies

8. Shell Programming and Scripting

sed special characters issues

I am dusting off the sed cobwebs and had a basic question: I have a file that contains: $firewall = "on"; $cache = "on"; $dataset{'mary had a little lamb'} = "on"; and want to only change the contents of what is between the single quotes: $dataset{'big bad wolf'} = "on"; I... (3 Replies)
Discussion started by: metallica1973
3 Replies

9. Shell Programming and Scripting

Sed: removes \ from text which causes issues

Hi all, Hoping someone hoping someone might be able to help. i've got the following sed command which i'm using in a bash script that i'm trying to use to insert a new line into an already existing file so i don't have to manually enter it when setting stuff up. the existing script test2/3 are... (3 Replies)
Discussion started by: springs2
3 Replies

10. Shell Programming and Scripting

Issues with using sed with word delimiters \< and \>

sed is not applying /d "delete line" option when I also include match word options \< and \> examples... echo cat | sed '/\<cat\>/d' will return cat for some reason echo cat | sed "/\<cat\>/d" will also still return cat. Of course I can just run this... echo cat | sed '/cat/d' and... (1 Reply)
Discussion started by: escooter87
1 Replies
FSDB(8) 						    BSD System Manager's Manual 						   FSDB(8)

NAME
fsdb -- FFS debugging/editing tool SYNOPSIS
fsdb [-dFn] -f fsname DESCRIPTION
fsdb opens fsname (usually a raw disk partition) and runs a command loop allowing manipulation of the file system's inode data. You are prompted to enter a command with ``fsdb (inum X)>'' where X is the currently selected i-number. The initial selected inode is the root of the filesystem (i-number 2). The command processor uses the editline(3) library, so you can use command line editing to reduce typing if desired. When you exit the command loop, the file system superblock is marked dirty and any buffered blocks are written to the file system. The -d option enables additional debugging output (which comes primarily from fsck(8)-derived code). The -F option indicates that filesystem is a file system image, rather than a raw character device. It will be accessed 'as-is', and no attempts will be made to read a disklabel. The -n option disables writing to the device, preventing any changes from being made to the filesystem. COMMANDS
Besides the built-in editline(3) commands, fsdb supports these commands: help Print out the list of accepted commands. inode i-number Select inode i-number as the new current inode. back Revert to the previously current inode. clri Clear the current inode. lookup name cd name Find name in the current directory and make its inode the current inode. Name may be a multi-component name or may begin with slash to indicate that the root inode should be used to start the lookup. If some component along the pathname is not found, the last valid directory encountered is left as the active inode. This command is valid only if the starting inode is a directory. active print Print out the active inode. uplink Increment the active inode's link count. downlink Decrement the active inode's link count. linkcount number Set the active inode's link count to number. ls List the current inode's directory entries. This command is valid only if the current inode is a directory. blks List the current inode's blocks numbers. findblk disk block number ... Find the inode(s) owning the specified disk block(s) number(s). Note that these are not absolute disk blocks numbers, but offsets from the start of the partition. rm name del name Remove the entry name from the current directory inode. This command is valid only if the current inode is a directory. ln ino name Create a link to inode ino under the name name in the current directory inode. This command is valid only if the current inode is a directory. chinum dirslot inum Change the i-number in directory entry dirslot to inum. chname dirslot name Change the name in directory entry dirslot to name. This command cannot expand a directory entry. You can only rename an entry if the name will fit into the existing directory slot. chtype type Change the type of the current inode to type. type may be one of: file, dir, socket, or fifo. chmod mode Change the mode bits of the current inode to mode. You cannot change the file type with this subcommand; use chtype to do that. chflags flags Change the file flags of the current inode to flags. chown uid Change the owner of the current inode to uid. chgrp gid Change the group of the current inode to gid. chgen gen Change the generation number of the current inode to gen. mtime time ctime time atime time Change the modification, change, or access time (respectively) on the current inode to time. Time should be in the format YYYYMMDDHHMMSS[.nsec] where nsec is an optional nanosecond specification. If no nanoseconds are specified, the mtimensec, ctimensec, or atimensec field will be set to zero. quit, q, exit, <EOF> Exit the program. SEE ALSO
editline(3), fs(5), clri(8), fsck(8) HISTORY
fsdb uses the source code for fsck(8) to implement most of the file system manipulation code. The remainder of fsdb first appeared in NetBSD 1.1. WARNING
Use this tool with extreme caution -- you can damage an FFS file system beyond what fsck(8) can repair. BUGS
Manipulation of ``short'' symlinks doesn't work (in particular, don't try changing a symlink's type). You must specify modes as numbers rather than symbolic names. There are a bunch of other things that you might want to do which fsdb doesn't implement. BSD
January 3, 2004 BSD
All times are GMT -4. The time now is 01:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy