Script invoked using "sh" is not executing. Urgent help required
Hi ,
I am new to shell scripting.
I am using Linux for doing scripting.
Below is my script, which takes 2 parameters as input.
test.sh has the below:
1st parameter is command line string
2nd parameter is the name of the global variable initialised in .profile file.
if i execute this script using ". ./test.sh global filename" its running prefectly.
But when i try to execute as "sh test.sh global filename" its not executing and output is not created.
Can anyone help me on this. I need to run this script using "sh".
Thanks
Sesha
Moderator's Comments:
Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.
Last edited by zaxxon; 05-10-2011 at 10:00 AM..
Reason: code tags
The display corruption in your error messages and the odd ^M suggest that your script file is not a unix format text file and contains carriage-return characters. Chances are that it has been edited with a Microsoft program such as "Notepad".
Please post the output from this command which is designed to make control codes visible. In a normal unix format text file the line terminator will be displayed as "$". Any extraneous carriage return characters will show as "\r".
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hi All,
i am trying to ssh to a remote machine and execute certain command to remote machine through script.
i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as
expect: spawn id exp5 not open
while executing
"expect "$" {... (3 Replies)
Hi,
I have an automated script which have set of sqls but when i am trying to execute the automated script by using nohup command, it is throwing an error like "Input is not UTF-8" .
And when i digged in to it, i am getting some "Â" character in the shell script.
How to avoid this!?
Thanks. (1 Reply)
I am facing this weird issue where the script is working fine from the command line but when I am executing it from cron though it is working fine but the "if" loop is processing else part though I know that the if part of the logic is true and ideally the loop should execute the if portion.
... (3 Replies)
I wrote a script to download the files from sftp location to local. while running the script manually its working fine. when i schedule the same in cron its not working.... :wall::wall:
here is the script:
#!/bin/bash
... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Dear All,
I am trying to capture the terminal session using the script command. It works when i issue on that has a command. But it is not working on inside a shell script as it is expecting a exit command to come out. Even after I ran the script and it expects me type the exit command and not... (14 Replies)
Hi All,
I know this has been discussed a lot but still I need some more answers. I am running this is ksh on AIX 5.3
I believe putting a "." in front of the script will start a new shell, is that correct??
I have a script which override some PATH variables and it does not do that... (3 Replies)
Hi.
i have written a wrapper script which inturn call the ftp child script in it. Now the problem is when i executing the same script in my script directory through putty it is getting executed successfully;where as through telnet i get an error "scripts not found" Can some one help me...
... (1 Reply)
:D I have been through the man pages and am not understanding the purpose of even what is a "Log File:"... I would like to be be able to access this application.. since it looks like something i could use but i am not sure what it is.. can some one clarify the matter.. and how to use it...
thanx... (4 Replies)