Hi ,
I'm facing a different behaviour with one of my shell script for last few days. It was working good before that.
here is my code for the script FileRemove.sh
execution syntax for FileRemove.sh in my program: sh FileRemove.sh XYZ*.txt
For all my past days first argument passed as my old file which was created one or few days before in the path and second argument passed as a new file created in the path.
For example if I have 2 files as below
XYX20181225.txt
XYZ20181226.txt
then $1 passed as XYX20181225.txt and $2 passed as XYZ20181226.txt for the input argument XYZ*.txt.
But nowadays $2 getting passed as old file and $1 getting passed as new file. Because of this I'm deleting my new file in script instead of old file.
I know this is not the good way of scripting to delete the old file but can anyone advise why it worked all these months fine and suddenly for last one week it is creating issue for me.
I would like to process a list of files matching: GPS*\.xyz with an awk script. I would then like to output the files to GPS*\.xyz.out (e.g. the same file name appended with .out). Something like:
awk '{if(NR==1) {offset=-$1}; $1=$1+offset; print }' GPS*.xyz
this does exactly what I want EXCEPT... (3 Replies)
I am on HP-UX and I am trying to come up with a method to call in a list of files named like so.
filename020107.dat filename020207.dat filename020307.dat
Obviously I can list them ls them like so, ls filename*.dat. In case you did not notice the number is a date and I was hoping to match... (4 Replies)
How can I pass in an argument such as "*.k" to a bash script
without having to double-quote *.k and not having *.k
`glob` to match all files in the pattern?
I tried using noglob in my script but this didn't work the way I thought
it would.. expansion is still occuring, $# is higher than I... (3 Replies)
Hi,
I have a requirement where i need to write a script to create the new file from the given input file with the data in reverse order (bottom to top)
Sample data:
Input File--------------
Java
VB
Oracle
Teradata
Informatica
Output file:-----------------
Informatica
Teradata
Oracle... (3 Replies)
My script(3 arguments $1 = folder,$2 extension,$3 string) should do the following things:
-Enter in the folder of $1(if exists).
-Put ls *.$2 > temp.txt ( I use a temp file to store the result of ls command and if $2 = txt in this file I'll have all the .txt files of the folder)
-Now I want to... (2 Replies)
Hi guys,
Here is a simple script. It writes the current time to specific files in a directory.
The arguments are the names of the files to write the date to (without path nor extension).
root:~# cat /usr/local/bin/dummy.sh
#!/bin/sh -e
for file in $@; do
date >> /var/lib/$file.dat... (11 Replies)
hi guys,
jus some file globbing questions
sed "s/^.*on//"
what does the full stop and asterisk means?
i onli know that ^ means inverse or not (1 Reply)
Hello,
I am trying to replace the position of each row by the next row.
OS: Ubuntu 18.04, bionic
I'd appreciate your help.
input_file:
-O fileA
wget http://x.y.z./a
-O fileB
wget http://a.b.c./d
-O fileC
wget http://q.f.s/t
..
..
..
-O fileZZ
wget http://r.t.y/u
I expect: (6 Replies)
Discussion started by: baris35
6 Replies
LEARN ABOUT FREEBSD
atf-sh
ATF-SH(1) BSD General Commands Manual ATF-SH(1)NAME
atf-sh [-s shell] -- interpreter for shell-based test programs
SYNOPSIS
atf-sh script
DESCRIPTION
atf-sh is an interpreter that runs the test program given in script after loading the atf-sh(3) library.
atf-sh is not a real interpreter though: it is just a wrapper around the system-wide shell defined by ATF_SHELL. atf-sh executes the inter-
preter, loads the atf-sh(3) library and then runs the script. You must consider atf-sh to be a POSIX shell by default and thus should not
use any non-standard extensions.
The following options are available:
-s shell Specifies the shell to use instead of the value provided by ATF_SHELL.
ENVIRONMENT
ATF_LIBEXECDIR Overrides the builtin directory where atf-sh is located. Should not be overridden other than for testing purposes.
ATF_PKGDATADIR Overrides the builtin directory where libatf-sh.subr is located. Should not be overridden other than for testing purposes.
ATF_SHELL Path to the system shell to be used in the generated scripts. Scripts must not rely on this variable being set to select a
specific interpreter.
EXAMPLES
Scripts using atf-sh(3) should start with:
#! /usr/bin/env atf-sh
Alternatively, if you want to explicitly choose a shell interpreter, you cannot rely on env(1) to find atf-sh. Instead, you have to hardcode
the path to atf-sh in the script and then use the -s option afterwards as a single parameter:
#! /path/to/bin/atf-sh -s/bin/bash
ENVIRONMENT
ATF_SHELL Path to the system shell to be used in the generated scripts.
SEE ALSO atf-sh(3)BSD September 27, 2014 BSD