LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-20-2018, 09:37 AM   #1
rami-ali
LQ Newbie
 
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
Bash Scripting program


Hello
I need help to buildinig a simple scripting program

Last edited by rami-ali; 11-20-2018 at 10:34 AM.
 
Old 11-20-2018, 10:03 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I do not know print queues, but

Code:
working_dir=
copy_to=



while read f ; 
do

  cp "$f" "$copy_to"
 printer -o sides=tow-sided-long-edge "$f"
##/tmp/document.txt
done <<<"$(find "$working_dir" -type f -name "somefilenamingschem")"
maybe put a sleep state in there for wait times in printing.


mod:
you changed your question, changes everything.
Code:
#!/bin/bash
echo "Hello World"

Last edited by BW-userx; 11-20-2018 at 10:55 AM.
 
Old 11-20-2018, 10:13 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rami-ali View Post
Hello
I need help to buildinig a simple scripting program

program:write a program called printer to create backup of every file before sending it to the printer.

program execution:
printer [lpr_option1 lpr_option2...lpr_optionN]

programe execution example:
printer -o sides=tow-sided-long-edge /tmp/document.txt
Show us what you've done/tried so far, and tell us where you're stuck. Otherwise, you need to read the LQ Rules..don't just post your homework questions and expect others to do them. We are happy to HELP you, but don't ask us to do your work for you.
 
1 members found this post helpful.
Old 11-20-2018, 10:27 AM   #4
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
It seems that you have limited yourself to copying/pasting the wording of the problem.
As is, that's not really asking for help but rather asking for a whole turnkey solution.
As said by TB0ne, please tell us what you tried.
 
1 members found this post helpful.
Old 11-20-2018, 12:56 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
hm. Do you think deleting what you posted will help? Never mind. Please tell us what kind of help do you need! In post #3 you will find a link to bash scripting tutorials. Is this what you are looking for?
 
1 members found this post helpful.
Old 11-20-2018, 01:44 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by pan64 View Post
hm. Do you think deleting what you posted will help? Never mind. Please tell us what kind of help do you need! In post #3 you will find a link to bash scripting tutorials. Is this what you are looking for?
...and *THAT* is exactly why I quote posts 99% of the time. Had too many come back later and say "See! I told you all this in post #1!!!"
 
1 members found this post helpful.
Old 11-20-2018, 02:25 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
oh and scripts are not programs btw.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Shell Scripting Part I: Getting started with bash scripting LXer Syndicated Linux News 0 04-29-2015 08:03 AM
Bash Scripting – Code Structure - Defining Multiple Points Of Entry In Bash Script carlr Programming 10 08-25-2014 02:38 AM
[To share Bash knowledge]Notes for Advanced Bash-Scripting Version 10 (Latest) jcky Programming 4 07-31-2014 09:24 AM
LXer: Bash If statements, Exit Status and Comparison Operators, A beginners guide to bash scripting LXer Syndicated Linux News 0 06-29-2014 07:35 PM
Reading a bash variable in bash scripting problem freeindy Programming 3 11-27-2008 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration