Anybody know what's wrong with this syntax?
awk -v job="$job" 'BEGIN { FS="|"}
{print $1,$2," ",$4," ",$3\n,$5,"\n"}' list
It's keeping give me this message:
awk: syntax error near line 1
awk: bailing out near line 1
It seems awk has problem with my BEGIN command.
Any... (8 Replies)
Does anybody know how to print a variable passed to awk command?
awk -F"|" 'BEGIN {print $job,"\n","Question \n"} {print $1,$2$4," ",$3}' "job=$job1" file1
I am trying to pass job the variable job1.
the output is blank.
?? (3 Replies)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Hi,
Can you please help. I am scripting in sh and I am trying to simply copy one directory to another but for some reason my variables are not recognised?
echo "The latest version of the program is being found......."
cd $SOFTWARE/src/$progname
version=`ls $SOFTWARE/src/$progname | grep... (13 Replies)
I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename?
#!/bin/bash
filename=`echo $0`
/usr/bin/sed '/#include/ {
i\
the filename is `$filename`
}' $1
exit 0 (8 Replies)
The following subroutine prints 1 instead of the content of the Equipment variable. Can someone tell me why?
#!c:/perl/bin/perl.exe
#
use strict 'vars';
my $Equipments = "data/equips.txt";
unless (open(EQUIP_FH, "$Equipments")) {
print "errors: $Equipments\n"; # This line prints... (1 Reply)
Hi,
I am facing a challenge in fixing an issue in my installation scripts.Here is a situation:
There are 3 files which are invoked at a below given order:
Installer.ksh----->Installer.xml(Ant script)------->common.ksh
I am outputting a message from common.ksh at a terminal, after that trying to... (3 Replies)
I am having difficulties with the fllowing script:
!/bin/sh
voicemaildir=/var/spool/asterisk/voicemail/$1/$2/INBOX/
echo `date` ':' $voicemaildir >> /var/log/voicemail-notify.log
for audiofile in `ls $voicemaildir/*.wav`; do
transcriptfile=${audiofile/wav/transcript}
... (4 Replies)
I have a script.
#!/bin/sh
cur_$1_modify_time=Hello
echo "cur_$1_modify_time"
When I run like
sh /root/script1 jj
I expect value "Hello" being assigned to variable "cur_jj_modify_time" and output being "Hello" ie echoing $cur_jj_modify_time
But the output comes as
# sh... (3 Replies)
In the bash below the variable date displays in the echo. However when I use it in the for loop it does not. Basically, the user inputs a date then that date is converted to the desired format of (month-day-year, no leading 0). That input is used in the for loop to return every file that matches... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
hotswaprc
HOTSWAPRC(5) File Formats Manual HOTSWAPRC(5)NAME
hotswaprc - configuration file for hotswap
DESCRIPTION
/etc/hotswaprc is the global configuration file for the hotswap utility.
It allows system administrators to specify arbitrary shell scripts to be run after a device is inserted, as well as before and after it is
removed. Scripts are selected according to the model name retrieved from the device. This is particularly helpful for automatic configura-
tion of CD-RW drives, which require SCSI emulation and bypass normal access via the IDE subsystem.
hotswaprc is implemented as an Extensible Mark-up Language (XML) application. XML documents are structured using elements of the form
<tag-name> content <tag-name>. A Document Type Definition (DTD) describes the possible content of each element.
Please refer to the XML specification for more information. The hotswap distribution also contains an example file, doc/hotswaprc.example,
which includes the DTD for the configuration file format.
ELEMENTS
<hotswap>
This is the root element of the document. Each valid hotswaprc must contain exactly one <hotswap> element. The <hotswap> element may
contain an arbitrary number of <device> elements.
<device>
The configuration file contains one <device> element for every device for which scripts are defined. The <device> element is com-
posed of the following elements in this order: <name>, <post-insert>, <pre-remove>, <post-remove>. All but <name> are optional.
<name> The content of this element is the model identification string of the IDE device the current <device> element refers to.
<post-insert>
Contains the shell script that is to be executed after the device has been inserted and registered with the kernel.
<pre-remove>
Contains the shell script that is to be run before hotswap attempts to unregister the device.
<post-remove>
Contains the shell script that is to be run after the device had been unregistered.
REPORT BUGS
Report bugs to t.stadelmann1@physics.ox.ac.uk.
AUTHOR
Written by Tim Stadelmann.
SEE ALSO hotswap(1), xhotswap(1).
COPYRIGHT
Copyright (c) 2002-2003 Tim Stadelmann.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License (GPL), Version 2 or
any later version published by the Free Software Foundation.
26th November 2002 HOTSWAPRC(5)