TweetEvery command or program returns an exit code to convey the execution status - success or failure. In Linux, programs return zero in case of success and a non-zero value in case of an error.
Overview:
I have an AWK program that parses thru a database backup
server log file and outputs ths following parameters
Code:
SRNO DATE : TIME SIZE IN(KB) DATABASE NAME DUMP TYPE
1 May 16 2012: 13:30:00 6874 TestDB database
2 May 16 2012: 13:30:44 11462 master database
Problem:
This program has been tested and works without failure under the bash shell.
however when I try to run this progr
Here is my script (to find the files that contain a specified pattern) :
find . -type f -exec awk -v vawk="$1" '/'"$vawk"'/ {c++} c>0 {print ARGV[1] ; exit 0 } END { if (!
Code:
#!/bin/bash
some command here like (date)
another command here like (ls -a)
script // to start recording
other commands here or ./anotherscript
and here
and here
exit // to stop recording
another command here
and another one
The first problem is that script(to record file) doesnt start. Anyway, i've found several solutions using read or echo.
I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting:
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: tar: command not found
-bash: grep: command not found
-bash: cat: command not found
-bash: find: command not found
Hello - I'm a bash newbie and would be very grateful for your help.
I need to run a bash script via cron to update a file.
The file is a .DAT (similar to csv) and contains pipe separated values.
I need to insert a header row at the top.
I would like to:
1) Make a backup of the file
2) Insert a header row if not already present
3) Save the file (replacing the old one)
4) add a success or failure
HI Guys ,
Using UNIX ,I intend to check with correct file pattern Access_file_Record.YYYYMM in path /tmp
If the file exist in correct format come out from code .
If not found check with different file patterns for same month period YYYYMM ( Like Access_file_Record_YYYYMM.txt or Access_file_Record_.YYYYMM)
Any different pattern file should be renamed to expected file Access_file_Record.YYYYMM
I have a question on pattern matching.
I have a file with multiple patterns in it, say pattern.txt
Locus3039v1rpkm6.85
Locus3041v1rpkm6.84
Locus3042v1rpkm6.84
And the test file to search is file.txt -
Locus3039v1rpkm6.85 gi|350401309|ref|XM_003486067.1| 0 10 85 328 253 8e-12 78.8
Locus3039v1rpkm6.85 gi|350401301|ref|XM_003486066.1| 0 10 85 566 491 8e-12 78.8
Locus3039v1rpkm6.8
Hi All,
i'm writing a script where i have to grep for a pattern and the 3 lines after the pattern and comment them out.
Note that i have to do this for multiple files, i am able to grep the pattern and the next 3 lines but since solaris does not recognize the -i option, i was wondering if there was any workaround.