Please explain what below command does.
logger_cmd="logger -p local0.info ${prog}[$$]:"
$logger_cmd "There are no matching files in ${account_number} for: ${filelist}"
How can I write any message in log file?
I wrote below a command, but it didn't show any message in llog.txt. Help me.
logger -s "any message" -t "WARNING" -f ~/llog.txt
Log files are important when debugging or just to check how a system is performing, we usually use cat to list the log on the screen, but if we want to see a live view of the log file, the command is:
tail -f /var/log/logfile.log
$ tail -f /logs/filename.log | awk '!(/list)'
I am able to run this command in GNU Linux flavour
But when I written in a script it is not working.
test.ksh:
variable="/logs/filename.log | awk '!(/list)'"
tail -f $var
Getting the error as
tail: cannot open `|' for reading: No such file or directory
tail: cannot open `grep' for reading: No such file or directory
tail: cannot open `list' fo
Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).
From what I understand I can get a somewhat similar behavior by piping head into tail or viceversa, i.e.
Sending output from php script called from bash script to syslog
Im trying to create a bash script (to be called by a cron job) which calls a php file (which I have not made). Calling the php file is easy enough.
Ubuntu 12.04.1 64 Server
I am syncing between 2 servers. Under 10.10 all was good. I had some hardware replacements and time, so I started from scratch and built 2 new 12.04.1 installs.
I have the following bash script lines in a file named test.sh.
Code:
#!/bin/bash
#
# Write Date to cron.log
#
echo "Begin SSI Load $(date +%d%b%y_%T)"
#
# Get the latest rates file for processing.
#
d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1)
filename=$d
export filename
echo "The file name is $filename."
When I execute ./test.sh
Is there a way to use the "paste" command to combine files and have each line key off of a column? All this time I've been pasting files together and foolishly not checking the line count of each file. I have just found out that the line count is not the same for each file so the data is not being synchronised properly across the two files.
Hi,
I have an HTML form through which I get some text as input. i need to run a shell script say script.sh inside a perl-cgi script named main_cgi.sh on the form input.
I want to write the contents of the form in a file and then perform some command line operations like grep, cat on the text and thn output the result as HTML.
I am not able to find out what's gone wrong with the script.