Sponsored Content
Top Forums Shell Programming and Scripting How to save and execute terminal commands in shell? Post 302761125 by Akshay Hegde on Friday 25th of January 2013 06:15:05 AM
Old 01-25-2013
How to save and execute terminal commands in shell?

I frequently use some commands, which I want to save in some file say
Code:
myregularshell.sh

these are the commands I use, I tried saving and executing, but couldn't get the preview of execution, and result is also not coming if I copy same commands and paste it on terminal result is coming


Code:
cd go somewhere

echo "I am here $PWD"

sudo su

source /etc/profile

sh operation.sh arguments

echo "Operation over"

find /mypath/path iname "*.abc" -delete

echo "old files deleted"

mv -i *.xyz /mypath/path 

echo "new files moved "


Is there any way to save as shell script and execute ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to execute shell commands in awk script?

Greetings Friends, Suppose I wish to invoke some shell level commands inside an awk script how to do that? say I wish to use : "wc" on a record to count number of characters in a record Any clues? Thanks, Rishi (1 Reply)
Discussion started by: RishiPahuja
1 Replies

2. Solaris

terminal output - save to file?

I have a window open on my ultra 10 - a terminal window connecting to a server. Is there any way I can log all output to this window to a log file on my ultra 10 ? (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

4. Shell Programming and Scripting

execute shell commands with in sftp

Hi All, Please let me know how do I execute some of the shell commands like cat, find ,grep within sftp. Any help in this regard would be greatly appreciated. Thanks, (5 Replies)
Discussion started by: tommy1
5 Replies

5. OS X (Apple)

Help w/ save and executing terminal actions

Hey everyone, Being new to the deeper levels of OS X and UNIX I am hoping the bright minds on the board could push me in the right direction. On a daily basis I work as a CG Generalist (creating 3D for film) and I am using a 3th party render engine with my main 3D program (Autodesk Maya)... (0 Replies)
Discussion started by: SofusGraae
0 Replies

6. Shell Programming and Scripting

Shell script to execute commands in individual users' home directories

Hi, I am trying to write a shell script which execute certain commands within certain folders in each user's home directories I started off with a bash script - #!/bin/csh -f su -l cvsusr1 cvs -d /home/cvsadm/repository status But the shell script finishes immediately after... (1 Reply)
Discussion started by: rupa_lahiri
1 Replies

7. Shell Programming and Scripting

Shell: How to execute commands from another file?

I made a configuration file for my shell script in that all the values that the shell scipt needs, are defined, but I don't know how to let the shell script use those defined variables. Thank you for your help :) (3 Replies)
Discussion started by: Alkali
3 Replies

8. Shell Programming and Scripting

Shell script help to execute ssh remote commands

Hi, The below command is not giving me the count , Can somebody help me in re-writing this pls . Proc_Exist=`ssh -q -o "BatchMode=yes" -o "PasswordAuthentication=no" $OAUSER@${Primary_Node} ps -ef | grep -v grep | grep "${ICM_Proc}" |wc -l ` Also the same problem with below... (13 Replies)
Discussion started by: Y.balakrishna
13 Replies

9. Shell Programming and Scripting

Running q-shell commands( on IBM-i Series) from cygwin terminal (on windows)

I have cygwin installed on windows server and when I do echo $SHELL the output is /bin/bash I have created a ssh tunnel from this windows server through cygwin to ibm -i series which is running Q-shell. I am trying to invoke a utility wsadmin (used for scripting) on ibm-i from the... (12 Replies)
Discussion started by: gaurav99
12 Replies

10. Shell Programming and Scripting

How to execute application commands with shell script?

Hi Friends, We have a application "getstatus" which needs to run on application prompt. But it is not working with shell script. Example: Unix Root Prompt# execute "crp" to go to application prompt CRP>getstatus displays output of app health CRP>exit Unix Root Prompt# Script , which... (2 Replies)
Discussion started by: suresh3566
2 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy