Following Code gave me desired output
if [[ $Txn_amount != *"-"* ]]; then
Txn_amount=$( bc <<< "-$Txn_amount" )
else
Txn_amount=$( bc <<< "-1*$Txn_amount" )
fi
Type: Posts; User: sujitrjadhav; Keyword(s):
Following Code gave me desired output
if [[ $Txn_amount != *"-"* ]]; then
Txn_amount=$( bc <<< "-$Txn_amount" )
else
Txn_amount=$( bc <<< "-1*$Txn_amount" )
fi
Thanks.
It worked but like you said it generated an unexpected result.
If the Txn_amount read from the CSV is already negative then it generates following error and the output file shows...
Hi Friends,
I have written a bash script which reads values from a csv file. The script runs fine until it encounters a floating point number in the CSV file. My code has following "if condition"...
Problem solved. Here is what worked for me
I downloaded Driver Install Tool from http://support.brother.com/g/b/downloadlist.aspx?c=as_ot&lang=en&prod=hl1110_us_eu_as&os=128. I had tried this...
I recently bought Brother HL-1201 laser printer. The installation of driver was smooth on windows as drivers CD was provided with the printer. But on my laptop I have ubuntu 15.10 and while system is...
I have a HP Laserjet Professional MFP 1136m printer at office which is attached to a pc with windows 8 OS installed on it. When I try to find the network printer using hp-setup it does not detect it....
Ok. Got solution
var1=$(echo $line | cut -f1 -d,)
var2=$(echo $line | cut -f2 -d,)
Hi friends,
below here is sample data.
12345678,A N KARMARKAR
87645321,D M SUDHAKAR
23456781,D S GANESH
34567812,S B VARHADE
I am writing a bash script which need above given data be...
Thanks Very Much Steeldriver. It solved my problem.
Hi,
I have a file with name links.txt which have some urls on each line. I need to write a bash script which read each line from the file links.txt then concatenate the read url with text...
Got the solution !
wget ${feed} -O - 2>/dev/null | \
xmlstarlet sel -t -m "/rss/channel/item" \
-n -v "link" | grep "${d}"
Hi friends,
I am using following code in a bash script to filter article url links from a rss feed
wget -q -O- ${url} |\
grep "<link>"
Output of the code is
Thanks very much GrouchyGaijin all others for patiently helping me so much. I talked with support team of my webhost and I was told that ssh was not enabled for my account. Further, I have found that...
It seems solution to my problem is wput and scp
Nope. I am not using siteground. I generated ssh keys at server using cpanel and downloaded both private and public keys. But how do I import them on local machine?
I logged in cpanel and found that there is Manage SSH Key option in cpanel. There I have two options - Generate a new key and import key. What do I have to do to set up ssh?
I checked my local machine home directory it has subdirectory .ssh with a file known_hosts. I used filezilla to check my remote machine home directory and found that there is no such directory at...
What I have is a ftp username, a ftp server address. What command I may use to automate the same task of file transfer as I have a fixed file name with fixed local path and fixed remote path?
To be honest I do not understand these protocols and have no knowledge about networking and these file transfer protocols. I really do not know whether I am using correct command or not. I am using...
My web host have given me ftp user name and ftp address. By remote machine you mean server of webhost? I can not run that command on server. Is there any else way to check it? If, like you say, ssh...
How do I check it? I think I have ufw installed. One more thing- When I connect to my website using filezilla it is using a different port no- not port no 22
ping
infocafe@devils-home:~/Desktop$ ping ftp.mywebsite.com
PING ftp.mywebsite.com (??.??.??.??) 56(84) bytes of data.
64 bytes from ftp.mywebsite.com (??.??.??.??): icmp_seq=1 ttl=46 time=271...
I wish to automate a daily activity of uploading a specific file to a specific location at mywebsite. On google searching I found scp is command to get my work done
but when I run scp I get...
Thanks very much. codemaniac. I did not know anything about bash programming. But after some trial and error I am able to create a script that does what I want.
Hi Friends,
I need help to create a bash script. I use exiftool command to update metadata of a pdf file in following format
exiftool -Subject="Some Text:DD-MMM-YYYY" -Title="Some Text:...