Search Results

Search: Posts Made By: arijitsaha
1,621
Posted By arijitsaha
Shell script executing both the conditions.
I have written this script. This is used for creating a backup folder.


#!/bin/sh
#set -x
. /home/.profile
usage="Usage is $0"
usage="$usage [-b <dir>]"
# Use the getopt utility to set up...
1,394
Posted By arijitsaha
2 mails from mailx command
hi,

While using mailx command i am receiving 2 mails with the same content in both the mails.I am attaching a file to the mailx command.

In one mail file is coming as attachement and in other...
7,616
Posted By arijitsaha
Deleting entries older than 7 days from a file
Hi,

I have a file which contains entries in this format.
my-bin.000140
my-bin.000141
my-bin.000142
my-bin.000143
my-bin.000144
my-bin.000145
my-bin.000146
my-bin.000147
my-bin.000148...
1,784
Posted By arijitsaha
scp command
Hi,

Is there any way by which scp shall not prompt for a password?

When ever i fire scp command it should automatically move the files to the mentioned location without prompting for the...
1,247
Posted By arijitsaha
sh: /env/env_setup.sh: No such file or...
sh: /env/env_setup.sh: No such file or directorystill the same error

Just so you know, this is the 35th time a moderator has had to edit one of your posts to add code tags, or for another reason....
1,247
Posted By arijitsaha
in the cron i have mentioned the complete path ...
in the cron i have mentioned the complete path

30 5 * * * /home/scripts/jobs/backup.sh 2>err_bkp.txt |mailx -s "success" abc.cde@xyz.com <err_bkp.txt

Actually the script env_setup.sh is...
1,247
Posted By arijitsaha
Cron job not triggering.
Hi,

I have scheduled a job using cron but the job is not getting triggred because of the following error.

line 5: /env/env_setup.sh: No such file or directory

But the file env_setup.sh is...
11,999
Posted By arijitsaha
Numbers with leading zeros
Hi,

i have a variable which conatins values like 00001,0003,00067,00459.
I want to use the values one by one and in the same form as they are like 00001,0003,00067,00459.

Also can anyone...
1,419
Posted By arijitsaha
The files will be generated randomly with those...
The files will be generated randomly with those numbers.
What i want to do is the user will pass two file names like abc-bin.00004 and abc-bin.000010 and the script will copy all the files in...
1,419
Posted By arijitsaha
hi, The number of those files are getting...
hi,

The number of those files are getting generated randomly.
1,419
Posted By arijitsaha
Copying files excluding some files
Hi,

I have a folder which contains files in this format.

abc-bin.000001
abc-bin.000002
abc-bin.000003
abc-bin.000004
abc-bin.000005
abc-bin.000006
abc-bin.000007
abc-bin.000008...
2,478
Posted By arijitsaha
thanks raj_saini20
thanks raj_saini20
2,478
Posted By arijitsaha
Hi raj_saini20 y=$( awk -v val=$word_passed...
Hi raj_saini20

y=$( awk -v val=$word_passed '(/val/){getline;print $1}' test.txt )


this line is not returning any value.

See the output below.

+ usage='Usage is test.sh'
+...
2,478
Posted By arijitsaha
#!/bin/sh # The usage of this script. ...
#!/bin/sh
# The usage of this script.
usage="Usage is $0"
usage="$usage [-a <file>]"
usage="$usage [-b <pass_word>]"
usage="$usage [-c <data>]"

if [ $# == 0 ]; then
echo "Invalid script...
2,478
Posted By arijitsaha
haven't tried anything yet.getting no idea how to...
haven't tried anything yet.getting no idea how to do this.:confused:
2,478
Posted By arijitsaha
Picking values from a file.
Hi,

I have a file which contains values in this format.
abc
cde
fgh
ijk
lmn
opq
rst
uvw

The user will pass the required parameter from the command line.
My requirement is that script...
5,248
Posted By arijitsaha
Hi Can anyone tell me if any command gets...
Hi

Can anyone tell me if any command gets hanged in Unix what is its return code?

Is it a non -zero value?
5,248
Posted By arijitsaha
yes it will read the password. Need to remove...
yes it will read the password.
Need to remove that line.

how to check that it was able to establish the connection?

I want to exit the script if it was not able to establish the connection....
5,248
Posted By arijitsaha
After successful login a welcome message comes. ...
After successful login a welcome message comes.
If it does not come then it needs to exit the script.

It should wait for 10 seconds if that message comes within that time then its ok else exit...
5,248
Posted By arijitsaha
How to exit a shell script if a unix command does not return any value for 10 seconds?
Hi,

Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?

The scenarios is like this.

I want to login to a application using...
3,863
Posted By arijitsaha
$# also didnot worked. ksh -x test.sh +...
$# also didnot worked.

ksh -x test.sh
+ usage='Usage is test.sh'
+ usage='Usage is test.sh [-a <database>]'
+ usage='Usage is test.sh [-a <database>] [-b <parameter>]'
+ usage='Usage is...
3,863
Posted By arijitsaha
Hi, My script requires 3 command line...
Hi,

My script requires 3 command line arguments to execute it.
If someone does pass these 3 arguments then it should return that invalid invocation and the usage.But in my script even if i do...
3,863
Posted By arijitsaha
problem with getopts
Hi,

I have written a script to take command line arguments using geopts.This is the code.

#!/bin/sh
# The usage of this script.
usage="Usage is $0"
usage="$usage [-a <database>]"...
1,334
Posted By arijitsaha
Thats ok. But the problem is while executing...
Thats ok.
But the problem is while executing the script.
suppose i do not want to pass parameter 1 and 2,need to pass only parameter 3.

How to do that?

if a mention only one then it will...
1,334
Posted By arijitsaha
Selective command line parameters.
Hi,

I have a script which has 3 command line parameters.But sometimes it will also take 2 command line parameters or 1.How to do it?

I am using $1,$2... to specify the command line...
Showing results 1 to 25 of 73

 
All times are GMT -4. The time now is 12:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy