Change your awk backup so it saves the rest of the default: line
Or with sed
And restore with the following shell script ---------- Post updated at 03:08 PM ---------- Previous update was at 02:48 PM ----------
I didn't see Junior's proposal. Storing the whole line is most efficient!
And missed Scrutinizer's post. Go for that one!
This User Gave Thanks to MadeInGermany For This Post:
Need shell script to read two file at same time and print output in single file
Example I have two files 1) file1.txt 2) file2.txt
File1.txt contains
Aaa
Bbb
Ccc
Ddd
Eee
Fff
File2.txt contains
Zzz
Yyy
Xxx (10 Replies)
Hi all,
I am new to shell scripting.
I have dbf file and I need to convert it into csv file.
OR, can i read the fields from a .dbf file and OR seprate the records in dbf file and put into .csv or txt.
Actually in the .dbf files I am getting , the numbers of fields may vary in very record and... (6 Replies)
I'm writing a bash script that reads a file location from a user, and I'm wondering how to get the script to accept tab to auto complete the directories that are input. (8 Replies)
hi all
i have a problem how to read file location..I read file as FILE=/home/tmp/new.file.but t is not useful for me.But i want my script read file location where the file is and copy in directory at boot time. Every time of booting files are copied in respective folder.please help !!!!:) (2 Replies)
I'm trying to write a script that will do an ls of a location, echo it into a file, and then read that file and selectively delete files/folders, so it would go something like this:
cd $CLEAN_LOCN
ls >>$TMP_FILE
while read LINE
do
if LINE = $DONTDELETE
skip
elseif LINE =... (2 Replies)
Hi,
I am using Solaris 10 OS and trying to create shell script that can add input at certain location into a file.
The input that I am trying to put is new domain name
e.g
@newdomain.com
the file contains,
more test01.out
user/zzzz786@st.com/INBOX
user/zzzz@po.com/INBOX... (8 Replies)
Hi,
I have a file with few values in it. I need script help to read file line by line and check:
1/if it's a file (with extension eg .java .css .jar etc )
or
2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
I've got a file that looks like this (spaces before first entries intentional):
12345650-000005000GL140227 ANNUAL HELC FEE EN
22345650-000005000GL140227 ANNUAL HELC FEE EN
32345650-000005000GL140227 ANNUAL HELC FEE EN
I want to read through the file line by line,... (6 Replies)
Is there any possible way transfering the file from unix to shared location using shell script.
i had created the batch script to fetch the files from unix to shared location and it works fine. Due to some problem in windows unable to transfer the file to shared location automatically. can anyone... (2 Replies)
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
LEARN ABOUT CENTOS
targetctl
targetctl(8) System Manager's Manual targetctl(8)NAME
targetctl - Save and restore configuration of kernel target
DESCRIPTION
targetctl is a low-level script to save and restore the configuration of the LIO kernel target, to and from a file in json format. It is
not normally meant to be used by end-users directly, but by system init frameworks, or advanced end-users who are generating the configura-
tion file themselves and need a way to load the configuration without relying on the targetcli configuration shell.
USAGE
targetctl must be invoked as root. Exit status will be 0 if successful, or nonzero if an error was encountered.
targetctl save [config-file]
Saves the current configuration of the kernel target to a file in json format. Since the file may contain cleartext passwords, the file's
permissions will be set to only allow root access. If config-file is not supplied, targetctl will use the default file location, /etc/tar-
get/saveconfig.json.
targetctl restore [config-file]
Removes any existing configuration and replaces it with the configuration described in the file. See saveconfig.json(5) for more details.
If parts of the configuration could not be restored, those parts will be noted in the error output, and the rest of the configuration will
still be applied.
targetctl clear
Removes any existing configuration from the running kernel target.
targetctl --help
Displays usage information.
SEE ALSO targetcli(8), targetd(8), saveconfig.json(5)FILES
/etc/target/saveconfig.json
/sys/kernel/config/target
AUTHOR
Written by Andy Grover <agrover@redhat.com>.
Man page written by Andy Grover <agrover@redhat.com>.
REPORTING BUGS
Report bugs via <targetcli-fb-devel@lists.fedorahosted.org>
or <https://github.com/agrover/rtslib-fb/issues>
targetctl(8)