This is my code:
# Generate Datetime
FILENAME="date +%Y%m%d%H%M%S"
# Dump Database
dumpdb FILENAME
# Upload to S3
python uploaddb.py FILENAME
My worry is that I want to keep referring to "FILENAME" variable except every second the variable will change its value.
I have changed my file names from filename.asp to filename.php but now I want to 301 redirect all the requests coming to filename.asp to its equivalent filename.php
I have tried these variations but they only redirect to the homepage:
if ($request_uri ~ ..asp.) {
rewrite ^ http://$host?
our user creates a text file with a white space on the filename. this same file is transfered to unix via automation tool. i have a korn shell script that reads these files on a input directory and connects to oracle database to run the oracle procedures which will load the data from each of the files.
There are lots of questions asked about batch renaming already, but I think my problem is a bit different. I need to rename a lot of files by switching around the components of the filename.
Example:
Original filename: BGP-2012-LOG-KTH-01.doc
New filename: 2012-BGP-KTH-LOG-01.doc
The different parts of the filename are delimited by dashes.
I wrote the following script to use it in Nautilus. It merges files into folders. But when I try this for sftp://user@mynas/ it is not working. How can I fix the script to get it working via the remote connections, too?
I am trying to write a small shell script that makes the multiple copies of a file. I am able to take the file name as input but not the number of copies. Here is what I wrote. But I am unable to pass the NUMBER variable to for loop.
echo -n "Enter filename: "
read FILENAME
echo -n "Number of copies to be made: "
read NUMBER
for i in {2..$NUMBER}
do
cp -f $FILENAME ${FILENAME%%.*}"_"$i.csv
done
Hey all, so I wrote a pretty simple script. It's viewable here:
Code:
#!/bin/sh
FILE=`ls $1`
for filename in $FILE
do
echo $filename
`echo $filename | tr e 5 `
done
So, as you can see it gets the list from a command line specified directory. It then loops through, echoes the filename, and then does an echo, using the tr function.
gauthma wrote:Thanks for the quick reply. I had no manpage for "source"[karol@black ~]$ help source
source: source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell.
Dear All
I am using the following shell script to extract the columns from the file.
<code>
for filename in *.rpt
do
awk -F"\t" '
BEGIN {OFS="|"} FNR > 0 {print $1,$2,$3,$5,FILENAME}
' $filename >> output.txt
done
</code>
However, the script works fine.