Sponsored Content
Top Forums Shell Programming and Scripting sed command not working inside ksh script but works fine outside Post 302860569 by vital_parsley on Sunday 6th of October 2013 02:47:10 PM
Old 10-06-2013
Thanks guys for all the help.I followed your responses and found that my first mistake was the $SEPARATOR variable was out of scope of the block so was not resolving correctly.
Secondly the caret A was not getting removed from the file is because ..when the job ran the wrapper script changed the LANG variable and so the caret A was not getting removed.I have explicitly exported it in the script and now its fine.

Thanks guys for all the help!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script works fine until I | more

Hello all, This beats me. I have a script that executes some commands and redirects their output to some text files that I will parse. The commands are along the lines of: dsmadmc -id=admin -pa=admin -outfile=/home/tools/qlog.txt q log f=d If I just run the script it works. If I execute... (2 Replies)
Discussion started by: Skovian
2 Replies

2. UNIX for Advanced & Expert Users

formatting textfile inside ksh script using awk not working

I cannot seem to get this text file to format. Its as if the awk statement is being treated as a simple cat command. I manned awk and it was very confusing. I viewed previous posts on this board and I got the same results as with the the awk command statement shown here. Please help. ... (6 Replies)
Discussion started by: tekline
6 Replies

3. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

4. Shell Programming and Scripting

Script works fine but not with crontab

Hello All, This is driving me nuts. Wrote a very simple script (it's in csh so sorry about that). Just something very simple though. Here is the catch. Works great from command line sometimes. Other times it runs no errors or anything but I never receive an email. Never runs from crontab... (6 Replies)
Discussion started by: jacktay
6 Replies

5. Shell Programming and Scripting

help with shell script: cp command not working, but mv command works...

Hello. I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct. We have a script (ftp.script) which calls on... (1 Reply)
Discussion started by: udelalv
1 Replies

6. Shell Programming and Scripting

Sed script not working properly on Solaris (works fine on AIX)?

Hi, I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system. The ksh script executes the SED and puts the output in HTML in tables. But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
Discussion started by: Faith111
7 Replies

7. Shell Programming and Scripting

Not the correct output, works fine via CLI, not inside the script.

Guys, I need you help please. The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") " Syntax RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "` echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies

8. Shell Programming and Scripting

Getting Command not found error Even though Script is working fine

Hi friends, I am using below script to do some work. But even though script is working fine but while executing it i am getting command not found error. :( Here is the script :- #!/bin/sh Names="name.txt" ###main##### for LINE in `cat ${Names}` do ... (3 Replies)
Discussion started by: harpal singh
3 Replies

9. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

10. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
GIT-CHECK-REF-FOR(1)						    Git Manual						      GIT-CHECK-REF-FOR(1)

NAME
git-check-ref-format - Ensures that a reference name is well formed SYNOPSIS
git check-ref-format <refname> git check-ref-format --print <refname> git check-ref-format --branch <branchname-shorthand> DESCRIPTION
Checks if a given refname is acceptable, and exits with a non-zero status if it is not. A reference is used in git to specify branches and tags. A branch head is stored under the $GIT_DIR/refs/heads directory, and a tag is stored under the $GIT_DIR/refs/tags directory (or, if refs are packed by git gc, as entries in the $GIT_DIR/packed-refs file). git imposes the following rules on how references are named: 1. They can include slash / for hierarchical (directory) grouping, but no slash-separated component can begin with a dot .. 2. They must contain at least one /. This enforces the presence of a category like heads/, tags/ etc. but the actual names are not restricted. 3. They cannot have two consecutive dots .. anywhere. 4. They cannot have ASCII control characters (i.e. bytes whose values are lower than 40, or 177 DEL), space, tilde ~, caret {caret}, colon :, question-mark ?, asterisk *, or open bracket [ anywhere. 5. They cannot end with a slash / nor a dot .. 6. They cannot end with the sequence .lock. 7. They cannot contain a sequence @{. 8. They cannot contain a . These rules make it easy for shell script based tools to parse reference names, pathname expansion by the shell when a reference name is used unquoted (by mistake), and also avoids ambiguities in certain reference name expressions (see git-rev-parse(1)): 1. A double-dot .. is often used as in ref1..ref2, and in some contexts this notation means {caret}ref1 ref2 (i.e. not in ref1 and in ref2). 2. A tilde ~ and caret {caret} are used to introduce the postfix nth parent and peel onion operation. 3. A colon : is used as in srcref:dstref to mean "use srcref's value and store it in dstref" in fetch and push operations. It may also be used to select a specific object such as with git cat-file: "git cat-file blob v1.3.3:refs.c". 4. at-open-brace @{ is used as a notation to access a reflog entry. With the --print option, if refname is acceptable, it prints the canonicalized name of a hypothetical reference with that name. That is, it prints refname with any extra / characters removed. With the --branch option, it expands the `previous branch syntax'' `@{-n}. For example, @{-1} is a way to refer the last branch you were on. This option should be used by porcelains to accept this syntax anywhere a branch name is expected, so they can act as if you typed the branch name. EXAMPLES
o Print the name of the previous branch: .ft C $ git check-ref-format --branch @{-1} .ft o Determine the reference name to use for a new branch: .ft C $ ref=$(git check-ref-format --print "refs/heads/$newbranch") || die "we do not like '$newbranch' as a branch name." .ft GIT
Part of the git(1) suite Git 1.7.1 07/05/2010 GIT-CHECK-REF-FOR(1)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy