[SOLVED] script for inserting line at specific place in file
I use zentyal for my server admin, which is great but zentyal auto-generates config file on boot and hence overwrites any changes made directly to config files. In order to allow multiple user access to a MS ACCESS database, I need to customise the smb.conf file and add the following line to the appropriate share declaration in the smb.conf file:
I know that zentyal will over write any changes I make directly to the file and will have to use a script in the /etc/ebox/hooks/ directory. My problem is adding the line to the correct part of the file. Here's my script:
The problem is that I need it inserted after the share declaration [share], this script currently places it at the end of the file.
Any suggestions? Thanks
Last edited by barrydocks; 12-29-2010 at 02:48 PM..
Hello,
I need to search in file2 for
class A : public B
{
and insert right after that the content of file1.
I am a bit lost as to which tools (which bash functions, awk...). I should use. Thanks for some directions here.
Regards (1 Reply)
I have a file that I want to split in 2 (with Bourne shell sh) preferably. The file consists of groups of lines separated by newline. The file can vary in length, so I need to check number of groups of text. Here's an example
====EXAMPLE START====
#fruit banana
#color yellow
#surface smooth... (0 Replies)
If I cat a file
And want to go to the first instance of a particular value - what command would I use?
And then from that point where I jumped to search for another value - but only search from that point forward not before the file?
Thanks~ (2 Replies)
this is utterly embarassing :(
after posting here i revisited my files and found that when i used "vi" instead of a gui based editor, i suddenly found that the indentations were in fact wrong :(
sorry about this :( (0 Replies)
Hello, I am using tcsh on AIX.
I would like to write a script that does the following:
1. given an inode, how do I find exactly the name of the file?
I know I could do this using ls -i | grep <inode>
but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Hi
I would love a bit of help with a problem im having with a script. I need to insert a line of text which is saved in a variable called $fwInsert into a file whos name is saved in a variable called $server but it needs to be in a certain order.
The file is a forward file for a network and... (12 Replies)
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Hello,
I'm trying to create multiple commands using a variable input from another file but am not getting any successful results.
Basically, file1.txt contains multiple lines with single words:
<file1.txt>
yellow
blue
black
white
I want to create multiple echo commands with these... (8 Replies)
I am trying to use awk to place the contens of a filename in $1 and $2 followed by the data in the text file. Basically, put the filename within the text file. There are over 1000 files in the directory and as of now each file is saved with a unique name but it is not within the file. Thank you... (10 Replies)
Discussion started by: cmccabe
10 Replies
LEARN ABOUT OSX
mount_smbfs
MOUNT_SMBFS(8) BSD System Manager's Manual MOUNT_SMBFS(8)NAME
mount_smbfs -- mount a shared resource from an SMB file server
SYNOPSIS
mount_smbfs [-N] [-o options] [-d mode] [-f mode] [-h] //[domain;][user[:password]@]server[/share] path
DESCRIPTION
The mount_smbfs command mounts a share from a remote server using SMB/CIFS protocol.
The options are as follows:
-N Do not ask for a password. At run time, mount_smbfs reads the ~/Library/Preferences/nsmb.conf file for additional configuration
parameters and a password. If no password is found, mount_smbfs prompts for it.
-o Options passed to mount(2) are specified with the -o option followed by a comma separated string of options. See the mount(8) man
page for possible options and their meanings. Additional options supported by the mount_smbfs are as follows:
nobrowse
Indicate to the Carbon subsystem that this volume is not to be displayed to the user.
automounted
Set flags on the mountpoint to indicate that the volume has been mounted by the automounter.
nostreams
Don't use NTFS Streams even if they are supported by the server.
soft Make the mount soft. Fail file system calls after a number of seconds.
nonotification
Turn off using notifications for this volume.
-f mode, -d mode
Specify permissions that should be assigned to files and directories. The values must be specified as octal numbers. Default value
for the file mode is taken from mount point, default value for the directory mode adds execute permission where the file mode gives
read permission.
Note that these permissions can differ from the rights granted by SMB server.
-h Prints a help message, much like the SYNOPSIS above.
//[domain;][user[password]@] server[/share]
The mount_smbfs command will use server as the NetBIOS name of remote computer, user as the remote user name and share as the
resource name on a remote server. Domain and/or password may be specified here. If user is omitted the logged in user id will be
used. Omitting share is an error when mount_smbfs is run from the command line, otherwise a browsing dialogue is presented.
path Path to mount point.
FILES
nsmb.conf Keeps static parameters for connections and other information. See man nsmb.conf for details.
EXAMPLES
This example shows the proper url to use to mount the share PUBLIC from the SMB server myserver :
mkdir /smb/public
mount -t smbfs //username:userpass@myserver/PUBLIC /smb/public
This example shows the proper url to use to mount the share PUBLIC from the SMB server myserver as guest:
mkdir /smb/public
mount -t smbfs //guest:@myserver/PUBLIC /smb/public
Note: You should always use the system mount command and never call mount_smbfs directly.
SEE ALSO mount(2), nsmb.conf(5), mount(8), umount(8)BUGS
Please report bugs to Apple.
AUTHORS
Boris Popov <bp@butya.kz>, <bp@FreeBSD.org>
FreeBSD March 10, 2000 FreeBSD