Unix C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.

creating a blank file within a shellscript

5 posters

Go down

creating a blank file within a shellscript Empty creating a blank file within a shellscript

Post by subhajit Fri Mar 12, 2010 3:48 pm

to create a blank file within in a shell script
i have done it this way...

cat >> filename << "";

but i think there is any other better way....can u please suggest any better way... Neutral

subhajit

Posts : 11
Points : 17
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Christopher Fri Mar 12, 2010 3:58 pm

just use cat>filename and press ctrl+D.
Christopher
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 35

https://unixcpp.forumotion.com

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by subhajit Fri Mar 12, 2010 4:14 pm

how can i press ctrl+D within in a shell script.....i have written it in a shellscript....there ar many code after that.....

subhajit

Posts : 11
Points : 17
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Christopher Fri Mar 12, 2010 4:19 pm

oh.. k k.
Christopher
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 35

https://unixcpp.forumotion.com

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by anand Fri Mar 12, 2010 4:41 pm

@:chris .... bulb!!!!!
anand
anand

Posts : 55
Points : 70
Join date : 2010-02-26
Age : 36

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Christopher Fri Mar 12, 2010 4:42 pm

Wink Wink
Christopher
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 35

https://unixcpp.forumotion.com

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by radhica Fri Mar 12, 2010 4:46 pm

way to go chris.... Laughing Laughing Laughing cheers Laughing
radhica
radhica

Posts : 1
Points : -1
Join date : 2010-03-02
Age : 36

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by anand Fri Mar 12, 2010 4:46 pm

anyways chris Idea
anand
anand

Posts : 55
Points : 70
Join date : 2010-02-26
Age : 36

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Christopher Fri Mar 12, 2010 4:49 pm

guys.. its time to go back to topic. anyone know how create a blank file in shell script???
Christopher
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 35

https://unixcpp.forumotion.com

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by urvershi Fri Mar 12, 2010 5:06 pm

cat > blankfile
echo "hiiiii"

execute dat shellscript and press ^D .

urvershi

Posts : 21
Points : 70
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by subhajit Fri Mar 12, 2010 5:15 pm

@ urvershi
how can i press ^D within a shellscript. Question

subhajit

Posts : 11
Points : 17
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by urvershi Fri Mar 12, 2010 5:35 pm

i hav written first execute dat shellscript and den press ^D.

urvershi

Posts : 21
Points : 70
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by subhajit Fri Mar 12, 2010 5:40 pm

thanks kartik!! Smile
the exact command is touch

$touch myfile.txt

subhajit

Posts : 11
Points : 17
Join date : 2010-02-26

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Christopher Fri Mar 12, 2010 5:41 pm

yup... it works well...
Christopher
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 35

https://unixcpp.forumotion.com

Back to top Go down

creating a blank file within a shellscript Empty Re: creating a blank file within a shellscript

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum