Sponsored Content
Top Forums Shell Programming and Scripting cat redirect EOF missing text Post 302422149 by juanb25 on Monday 17th of May 2010 03:11:03 PM
Old 05-17-2010
cat redirect EOF missing text

Hello attempting to redirect out to create a startup script in solaris. The steps are working but the $1 entry is being left out. syntax below and content of output file below.


Code:
cat > S99build << EOF
> #!/bin/bash
> case $1 in
> 'start')
> /usr/os-buildsol.sh
>
> ;;
> esac
> exit 0
> EOF

The $1 is not coming across in the output file

Code:
cat S99build
#!/bin/bash
case  in
'start')
/usr/os-buildsol.sh

;;
esac
exit 0


Last edited by Scott; 05-26-2010 at 05:07 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using cat and grep to display missing records

Gentle Unix users, Can someone tell me how I can use a combination of the cat and grep command to display records that are in FileA but missing in FileB. cat FileA one line at a time and grep to see if it is in fileB. If it is ignore. If line is not in fileB display the line. Thanks in... (4 Replies)
Discussion started by: jxh461
4 Replies

2. UNIX for Dummies Questions & Answers

regarding cat and EOF in UNIX

Hi, Can anyone explain me what this function is doing cat << EOF > HELPFILE /$1/ { print "SENT" } EOF Thanks in Advance Suggestions welcome (1 Reply)
Discussion started by: trichyselva
1 Replies

3. Shell Programming and Scripting

redirect cat to variable

hello just i saw a really strange for cat i have file (file1) contains line /home/rajiv/proj1/*.txt now applied a commonds DDPATH="$(cat file1)" echo $DDPATH it shows all the txt files in that folder like /home/rajiv/proj1/read1.txt /home/rajiv/proj1/read2.txt... (7 Replies)
Discussion started by: shailesh_arya
7 Replies

4. Shell Programming and Scripting

Adding timestamp after cat <<EOF >

Hi Team, I am trying to add timestamp to SQLs by taking the timestamp in variable through shell script.I started like this. cat << EOF > $MYDIR CONNECT TO $MYDB USER $MYUSR USING $MYPWD; T=`db2 -x "select CURRENT_TIMESTAMP from sysibm.sysdummy1 "`; DECLARE RECCUR CURSOR FOR... (3 Replies)
Discussion started by: rocking77
3 Replies

5. UNIX for Dummies Questions & Answers

Copying text from Windows to AIX - missing text?

Hi All, I'm hoping this is an easy question, but I'm having a weird problem trying to simply copy and paste text from MS Windows (XP) Notepad and then pasting into vi or vim in AIX. When I type "oslevel" I get "5.3.0.0". The problem is that once the text is pasted, there are sections of text... (2 Replies)
Discussion started by: PlainInverted
2 Replies

6. Shell Programming and Scripting

What's wrong with my cat EOF?

cat << EOF > tmp.sh #!/bin/sh mknod /dev/`cat /proc/devices | grep xx | sed -r 's/(.*) (.*)/\2 c \1/'` 0 chmod 777 /dev/xx (1 Reply)
Discussion started by: yanglei_fage
1 Replies

7. UNIX for Dummies Questions & Answers

How to append a string by cat and redirect to other file?

Hi, when I do cat for kernel parameters cat /proc/sys/kernel/sem >> /etc/sysctl.conf 4096 4096 32 128 The above command working with out any doubt but I want to pass it like below, need to append "kernel.sem =" and pass it to /etc/sysctl.conf kernel.sem = 4096... (2 Replies)
Discussion started by: stew
2 Replies

8. Shell Programming and Scripting

Cat files listed in text file and redirect to new directory with same filename

I have a directory that is restricted and I cannot just copy the files need, but I can cat them and redirect them to a new directory. The files all have the date listed in them. If I perform a long listing and grep for the date (150620) I can redirect that output to a text file. Now I need to... (5 Replies)
Discussion started by: trigger467
5 Replies

9. Shell Programming and Scripting

How to redirect the output when we are usinf EOF in the same line?

need to login 4 systems to check whether the systems are accessible or not using rlogin command,after each login i will exit.After issuing the command rlogin abc if it is not responding i will get a message of "connection timed out" . So i want to automate this task .so i tried like below : EX:... (1 Reply)
Discussion started by: charanarjun
1 Replies

10. Shell Programming and Scripting

How To Redirect The Output When We Are Usinf EOF In The Same Line?

need to login 4 systems to check whether the systems are accessible or not using rlogin command,after each login i will exit.After issuing the command rlogin abc if it is not responding i will get a message of "connection timed out" . So i want to automate this task .so i tried like below: EX: ... (3 Replies)
Discussion started by: kankuro9x
3 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/ksh93 /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/ksh93 /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/sfw/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. NOTES
Restricted shells should not be listed in /etc/shells. SunOS 5.11 1 Nov 2007 getusershell(3C)
All times are GMT -4. The time now is 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy