Why don't you append your data immediately to /etc/fstab in lieu of writing to a file and then reading that into a variable?
Compose the line in one go and append to /etc/fstab, e.g.
I'm trying to write a script that reads down a listcontaining various columns, if line1 column 1 != 0 then copy various field to variable field1, then check line1 column2 if > 0 this time copy to variable field2 ...
Once all columns checked I want to print the value of each variable if it exists... (2 Replies)
I suppose the easiest way to explain my problem is to show you some code and then show you what the code outputs:
--------------------------------------------------
#!/bin/bash
echo "This line has spaces" > "/tmp/This Filename Has Spaces.txt"
export Foo=$(cat "/tmp/This Filename Has... (4 Replies)
Hi
New at this, but want to learn more.
I'm trying this as an Shell Command in MacOSX;
newdate='<TIME>'
echo $newdate >> /Users/ttadmin/Desktop/test.txt
And it don't work. But if I just use;
echo <TIME> >> /Users/ttadmin/Desktop/test.txt
(<TIME> is an variable that one program... (6 Replies)
My file is in this format :
username : student information : default shell : student ID
Eg :
joeb:Joe Bennett:/bin/csh:1234
jerryd:Jerry Daniels:/bin/csh:2345
deaverm: Deaver Michelle:/bin/bash:4356
joseyg:Josey Guerra:/bin/bash:8767
michaelh:Michael Hall:/bin/ksh:1547
I have to... (1 Reply)
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:
I have to read the contents of each field of a file creating user accounts.
The file will be of format :
... (6 Replies)
Hello
i tried many times echo $variables into text file with no success
for example:
echo "#!/bin/sh
BBHTAG=RFOCLT_check # What we put in bb-hosts to trigger this test
COLUMN=RFOCLT # Name of the column, often same as tag in bb-hosts
$BBHOME/bin/bbhostgrep $BBHTAG | while read... (5 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
<tr><td bgcolor=#D7EBAD><b>Instructions :</b></td>
<td>`cat temp.txt`</td></tr>
Hi Experts,
I have an requirement of displaying file contents in HTML mail , for which am using the above approach, Where as the output is kind of not as expected.
If there are 5 lines in the file, in the... (4 Replies)
Hi All,
I was trying a shell script. I was unable to store file contents to a variable in the script. I have tried the below but unable to do it.
Input = `cat /path/op.diary`
Input = $(<op.diary)
I am using ksh shell. I want to store the 'op.diary' file contents to the variable 'Input'... (12 Replies)
Discussion started by: am24
12 Replies
LEARN ABOUT X11R4
fstab
FSTAB(5) File Formats FSTAB(5)NAME
fstab - static information about the filesystems
SYNOPSIS
/etc/fstab
DESCRIPTION
The file fstab contains descriptive information about the filesystems the system can mount. fstab is only read by programs, and not writ-
ten; it is the duty of the system administrator to properly create and maintain this file. The order of records in fstab is important
because fsck(8), mount(8), and umount(8) sequentially iterate through fstab doing their thing.
Each filesystem is described on a separate line. Fields on each line are separated by tabs or spaces. Lines starting with '#' are com-
ments. Blank lines are ignored.
The following is a typical example of an fstab entry:
LABEL=t-home2 /home ext4 defaults,auto_da_alloc 0 2
The first field (fs_spec).
This field describes the block special device or remote filesystem to be mounted.
For ordinary mounts, it will hold (a link to) a block special device node (as created by mknod(8)) for the device to be mounted,
like `/dev/cdrom' or `/dev/sdb7'. For NFS mounts, this field is <host>:<dir>, e.g., `knuth.aeb.nl:/'. For filesystems with no
storage, any string can be used, and will show up in df(1) output, for example. Typical usage is `proc' for procfs; `mem', `none',
or `tmpfs' for tmpfs. Other special filesystems, like udev and sysfs, are typically not listed in fstab.
LABEL=<label> or UUID=<uuid> may be given instead of a device name. This is the recommended method, as device names are often a
coincidence of hardware detection order, and can change when other disks are added or removed. For example, `LABEL=Boot' or
`UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. (Use a filesystem-specific tool like e2label(8), xfs_admin(8), or fatlabel(8) to set
LABELs on filesystems).
It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers are supported for example for GUID Partition Table
(GPT).
See mount(8), blkid(8) or lsblk(8) for more details about device identifiers.
Note that mount(8) uses UUIDs as strings. The string representation of the UUID should be based on lower case characters.
The second field (fs_file).
This field describes the mount point (target) for the filesystem. For swap partitions, this field should be specified as `none'. If
the name of the mount point contains spaces or tabs these can be escaped as ` 40' and '