Sponsored Content
Top Forums Shell Programming and Scripting Need assistance with a file issue and a terminal issue Post 302607899 by MrMagoo22 on Thursday 15th of March 2012 03:27:38 PM
Old 03-15-2012
Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for now I really could use some clarification on the two different tasks I need to setup in csh.

First one I've got about halfway finished. The assignment is to write a csh script that takes in a file and a directory name as parameters, validates that both arguments exist, then reads in a list of file names located in the parameter file and creates backups of those files within the param directory. I've got the permissions down, and I think I can handle creating the backup files, but I can't figure out any good way to read the file names from within the param file. Any commands I should be aware of here?

Second, and I haven't quite gotten very far on this one just yet, I need to create a simple script program which displays a welcome message to the user that opens it, but is only accessible from a specific terminal. Accessing the script from a different terminal should cause the program to immediately exit. Seems simple enough, but I don't know how to access the terminal ID or find any way to identify it.

If anyone is feeling generous enough to offer some assistance/clarification, I would greatly appreciate some help here. I'm pretty well stuck.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

2. UNIX for Advanced & Expert Users

Issue with File Permissions

one of the business users is ftping files into unix box using user name ftp_user, where as i am using infa_user to login into same unix box. When i am trying to access those or copy over those files from upload directory it says permission denied. Though i know the password of... (4 Replies)
Discussion started by: Ariean
4 Replies

3. Emergency UNIX and Linux Support

Spaces in File Name issue

Hi, I have a small issue while using variables for a file name in UNIX. I have file name like "abc def 123.txt" Folder will be in /zzz/xxx/yyy I created 2 variables Folder = '/zzz/xxx/yyy' file = 'abc def 123.txt' While using this in grep command i am... (6 Replies)
Discussion started by: pssandeep
6 Replies

4. Shell Programming and Scripting

Need assistance to resolve the KSH issue

am running the small script below. count_a=48 count_b=48 if ; then echo "Count matched" else echo "count not matched" fi I got the below output. /bin/ksh: [48: not found count not matched It was giving the same error when I ran in another box. But I inculded /bin/ksh in the... (10 Replies)
Discussion started by: sathik
10 Replies

5. Solaris

VI Editor issue "E558: Terminal entry not found in terminfo"

When trying to open a document with VI editor, getting the following error.. E558: Terminal entry not found in terminfo 'vt100' not known. Available builtin terminals are: builtin_gui builtin_riscos builtin_amiga builtin_beos-ansi builtin_ansi builtin_pcansi ... (8 Replies)
Discussion started by: vikram3.r
8 Replies

6. UNIX for Dummies Questions & Answers

ISSUE and ISSUE.NET files

In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH). Thanks (0 Replies)
Discussion started by: ejjones
0 Replies

7. Solaris

Terminal Emulation Issue

I am having issues with installation of Sterling-Gentran:Server for UNIX 6.1. The issue within the secadmin setup. I can get into the Security Admin Setup Screens and can navigate within but cannot reply to a popup screen (the software is asking me to confirm "YES" or "NO" and none of the keys on... (6 Replies)
Discussion started by: oakbob817
6 Replies

8. Shell Programming and Scripting

Issue with gnome terminal

Hi, I cant get this command to run in a new gnome terminal cd "$PRG" && gnome-terminal -x sh -c './prg -r testcommand' &>/dev/null & i can run just ./prg -r testcommand and it runs fine but in the command above it only runs ./prg Any ideas community Cheers in advance (0 Replies)
Discussion started by: digitalviking
0 Replies

9. UNIX for Advanced & Expert Users

Unix terminal display related issue

Want few input related to unix environment and terminal settings: 1. Am trying to find a way to keep the unix terminal display intact even after opening and closing a vi/less file. Currently if I open a vim file in the unix terminal and then close the file,it displays the contents of vim file on... (4 Replies)
Discussion started by: talktovkjain
4 Replies

10. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies
CHECKBASHISMS(1)					      General Commands Manual						  CHECKBASHISMS(1)

NAME
checkbashisms - check for bashisms in /bin/sh scripts SYNOPSIS
checkbashisms script ... checkbashisms --help|--version DESCRIPTION
checkbashisms, based on one of the checks from the lintian system, performs basic checks on /bin/sh shell scripts for the possible presence of bashisms. It takes the names of the shell scripts on the command line, and outputs warnings if possible bashisms are detected. Note that the definition of a bashism in this context roughly equates to "a shell feature that is not required to be supported by POSIX"; this means that some issues flagged may be permitted under optional sections of POSIX, such as XSI or User Portability. In cases where POSIX and Debian Policy disagree, checkbashisms by default allows extensions permitted by Policy but may also provide options for stricter checking. OPTIONS
--help, -h Show a summary of options. --newline, -n Check for "echo -n" usage (non POSIX but required by Debian Policy 10.4.) --posix, -p Check for issues which are non POSIX but required to be supported by Debian Policy 10.4 (implies -n). --force, -f Force each script to be checked, even if it would normally not be (for instance, it has a bash or non POSIX shell shebang or appears to be a shell wrapper). --extra, -x Highlight lines which, whilst they do not contain bashisms, may be useful in determining whether a particular issue is a false posi- tive which may be ignored. For example, the use of "$BASH_ENV" may be preceded by checking whether "$BASH" is set. --version, -v Show version and copyright information. EXIT VALUES
The exit value will be 0 if no possible bashisms or other problems were detected. Otherwise it will be the sum of the following error val- ues: 1 A possible bashism was detected. 2 A file was skipped for some reason, for example, because it was unreadable or not found. The warning message will give details. SEE ALSO
lintian(1). AUTHOR
checkbashisms was originally written as a shell script by Yann Dirson <dirson@debian.org> and rewritten in Perl with many more features by Julian Gilbey <jdg@debian.org>. DEBIAN
Debian Utilities CHECKBASHISMS(1)
All times are GMT -4. The time now is 02:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy