Sponsored Content
Top Forums Shell Programming and Scripting sed command to append word at end of line Post 303022752 by ghpradeep on Thursday 6th of September 2018 07:58:33 AM
Old 09-06-2018
Hello,
Because, In mount command output, it shows default option which are set on particular filesystem. which is not showing in /etc/fstab file. it only show defaults word there.

Code:
[root@test CIS]# mount |grep /data
/dev/mapper/datavg-lv_data on /data type ext4 (rw,relatime,seclabel,data=ordered)
[root@test CIS]#

I just tried you command. its working fine but i need specific to file system. i have data and data1 mount point. it should apply only /data only.
Code:
/dev/mapper/datavg-lv_data      /data   ext4    default2,nodev  0       0
/dev/mapper/datavg-lv_data1     /data1  ext4    default2,nodev  0       0

your command adding nodev on both filesystem.

Last edited by RudiC; 09-06-2018 at 09:08 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed to append text to the end of each line

Anyone know how to use SED to append a comma to the end of each line example: field1,field2,field3,field4 If i Cat /textfile ---- How can i append the end of /textfile with a comman? (8 Replies)
Discussion started by: Redg
8 Replies

2. Shell Programming and Scripting

sed append "\n" to end of every line in file

I know it sounds simple, but I want to e-mail the last 6 lines of a log file, which I have tailed into logresults.txt. I'm using echo -e "Subject:server results\nFrom:server log <user@domain.com>\n"`cat logresults.txt` | sendmail -t user@domain.com which works, but the body of the e-mail has... (4 Replies)
Discussion started by: unclecameron
4 Replies

3. Shell Programming and Scripting

Sed : identify a pattern and append a word at the end of a line

Hello to all, On aix, I want to identify a term on a line in a file and then add a word at the end of the line identified. I do not want the word to be added when the line contains the symbol "#". I use the following command, but it deletes the term identified then adds the word. #sed... (4 Replies)
Discussion started by: dantares
4 Replies

4. Shell Programming and Scripting

Using sed command to change end of line

I am looking to change a data file into a javascript string and this is the code that I am using: sed -i '' -e 's/^/str += "/' -e 's/$/";/' file.xml The first part -e 's/^/str += "/' works as intended, but the second part -e 's/$/";/' adds an additional newline to my file, so that instead of... (3 Replies)
Discussion started by: figaro
3 Replies

5. Shell Programming and Scripting

append "awk command" to the end of each line

hi; this is my qqq.mos: l ./gcsw 86.0.0.1 'lt all;l+;lset SectorPort=860 Tilt 861;l-' l ./gcsw 86.0.0.2 'lt all;l+;lset SectorPort=862 Tilt 863;l-' l ./gcsw 86.0.0.3 'lt all;l+;lset SectorPort=864 Tilt 865;l-' ... i want to append;l nawk 'NR==14 && $NF!="Set."{print "l ./gcsw "r"... (4 Replies)
Discussion started by: gc_sw
4 Replies

6. Shell Programming and Scripting

Append the text file with comma at the end of every word

Hi folks, Using shell, I am trying the append comma to every line of text. the requirement is like, I have to open the txt file in unix and read line by line and should add comma at the end of every word to make it single line txt file ------- abc@gmail.com bcd@gmail.com... (7 Replies)
Discussion started by: giridhar276
7 Replies

7. Shell Programming and Scripting

How to append something to a word using sed command

Hi, How to append something to already existing word. Suppose, I have the following line as a part of a file. VVV= jdbc:... (6 Replies)
Discussion started by: Dpu
6 Replies

8. Shell Programming and Scripting

SED and Solaris Append line to the end of File does not work

Hello, I have to add a new line at the end of a File on Solaris-System: I think my script should be right, because I evaluated it to other threads. However the script does not what I am expected it should do. My file might look like this: Line1 Line2 Line3 And my script could... (7 Replies)
Discussion started by: Timo_HR
7 Replies

9. Shell Programming and Scripting

sed - Find a String and append a text end of the Line

Hi, I have a File, which have multiple rows. Like below 123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY 123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY 123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies

10. Shell Programming and Scripting

How to append word count at end of file?

Hi guys, I have to append the word count of a file at the end of the file name like this - > "filename_2345" where 2345 is the word count of "filename". How do i achieve this using one command ? I am not allowed to store the word count in a variable and then concatenate. Request your... (1 Reply)
Discussion started by: peter2312
1 Replies
MOUNT(8)						    BSD System Manager's Manual 						  MOUNT(8)

NAME
mount -- mount file systems SYNOPSIS
mount [-adfruvw] [-t ufs | lfs | external_type] mount [-dfruvw] special | node mount [-dfruvw] [-o options] [-t ufs | lfs | external_type] special node DESCRIPTION
The mount command calls the mount(2) system call to prepare and graft a special device or the remote node (rhost:path) on to the file system tree at the point node. If either special or node are not provided, the appropriate information is taken from the fstab(5) file. The system maintains a list of currently mounted file systems. If no arguments are given to mount, this list is printed. The options are as follows: -a All the filesystems described in fstab(5) are mounted. Exceptions are those marked as ``noauto'' or are excluded by the -t flag (see below). -d Causes everything to be done except for the actual system call. This option is useful in conjunction with the -v flag to determine what the mount command is trying to do. -f Forces the revocation of write access when trying to downgrade a filesystem mount status from read-write to read-only. -o Options are specified with a -o flag followed by a comma separated string of options. The following options are available: async All I/O to the file system should be done asynchronously. This can be somewhat dangerous with respect to losing data when faced with system crashes and power outages. This is also the default. It can be avoided with the noasync option. force The same as -f; forces the revocation of write access when trying to downgrade a filesystem mount status from read-write to read-only. noasync This filesystem should not force all I/O to be written asynchronously. noauto This filesystem should be skipped when mount is run with the -a flag. nodev Do not interpret character or block special devices on the file system. This option is useful for a server that has file systems containing special devices for architectures other than its own. noexec Do not allow execution of any binaries on the mounted file system. This option is useful for a server that has file systems containing binaries for architectures other than its own. nosuid Do not allow set-user-identifier or set-group-identifier bits to take effect. rdonly The same as -r; mount the file system read-only (even the super-user may not write it). sync All I/O to the file system should be done synchronously. update The same as -u; indicate that the status of an already mounted file system should be changed. union Causes the namespace at the mount point to appear as the union of the mounted filesystem root and the existing directory. Lookups will be done in the mounted filesystem first. If those operations fail due to a non-existent file the underlying directory is then accessed. All creates are done in the mounted filesystem. Any additional options specific to a filesystem type that is not one of the internally known types (see the -t option) may be passed as a comma separated list; these options are distinguished by a leading ``-'' (dash). Options that take a value are specified using the syntax -option=value. For example, the mount command: mount -t hfs -o nosuid,-w,-m=755 /dev/disk2s9 /tmp causes mount to execute the equivalent of: /sbin/mount_hfs -o nosuid -w -m 755 /dev/disk2s9 /tmp -r The file system is to be mounted read-only. Mount the file system read-only (even the super-user may not write it). The same as the ``rdonly'' argument to the -o option. -t ufs | lfs | external type The argument following the -t is used to indicate the file system type. The type ufs is the default. The -t option can be used to indicate that the actions should only be taken on filesystems of the specified type. More than one type may be specified in a comma separated list. The list of filesystem types can be prefixed with ``no'' to specify the filesystem types for which action should not be taken. For example, the mount command: mount -a -t nonfs,hfs mounts all filesystems except those of type NFS and HFS. If the type is not one of the internally known types, mount will attempt to execute a program in /sbin/mount_XXX where XXX is replaced by the type name. For example, nfs filesystems are mounted by the program /sbin/mount_nfs. -u The -u flag indicates that the status of an already mounted file system should be changed. Any of the options discussed above (the -o option) may be changed; also a file system can be changed from read-only to read-write or vice versa. An attempt to change from read-write to read-only will fail if any files on the filesystem are currently open for writing unless the -f flag is also specified. The set of options is determined by first extracting the options for the file system from the fstab table, then applying any options specified by the -o argument, and finally applying the -r or -w option. -v Verbose mode. -w The file system object is to be read and write. The options specific to NFS filesystems are described in the mount_nfs(8) manual page. FILES
/etc/fstab file system table SEE ALSO
mount(2), fstab(5), mount_afp(8), mount_cd9660(8), mount_cddafs(8), mount_devfs(8), mount_fdesc(8), mount_hfs(8), mount_msdos(8), mount_nfs(8), mount_smbfs(8), mount_synthfs(8), mount_udf(8), mount_volfs(8), mount_webdav(8), umount(8) BUGS
It is possible for a corrupted file system to cause a crash. HISTORY
A mount command appeared in Version 6 AT&T UNIX. 4th Berkeley Distribution June 16, 1994 4th Berkeley Distribution
All times are GMT -4. The time now is 05:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy